Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
27615 | 唐心 | 报数 | C++ | Accepted | 2 MS | 736 KB | 417 | 2022-06-07 11:24:26 |
#include<iostream> #include<cstdio> #include<cstring> using namespace std; int main() { int j,i = 0,temp,n,num=0,arr[2000]={0}; cin>>n; temp = n-1; while(temp!=0) { num++; if(arr[num]!=1) { i++; if(i%3==0) { arr[num] = 1; i=0; temp--; } } if(num == n) num=0; } for(i=1;i<=n;i++) { if(arr[i]!=1) cout<<i<<endl; } return 0; }