cspjT1最后MLE
  • 板块学术版
  • 楼主xiaoyu2010
  • 当前回复7
  • 已保存回复7
  • 发布时间2023/10/21 15:16
  • 上次更新2023/11/2 12:14:58
查看原帖
cspjT1最后MLE
946420
xiaoyu2010楼主2023/10/21 15:16
#include<bits/stdc++.h>
using namespace std;
long long n,pop,day,p;
long long a[100000005];
int main() {
	cin>>n;
	while(n!=pop) {
		day++;
		int x=0;
		for(int i=1; i<=n; i++) {
			if(a[i]==0) {
				x++;
				if(x==1){
					if(i==n) p=day;
					a[i]=1;
					pop++;
				}
				if(x==3){
					x=0;
				}
			}
		}
	}
	cout<<day<<' '<<p;
	return 0;
}

救命

2023/10/21 15:16
加载中...