Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
32709 于俊杰 报数 C++ Accepted 3 MS 736 KB 344 2022-07-26 12:09:00

Tests(1/1):


Code:

#include<iostream> using namespace std; int main(){ int n,t=0,s=0; bool f[1005]={0}; cin>>n; for(int i=1;;i++){ if(i==n+1) i=1; if(!f[i]){ t++; if(t==3){ f[i]=1; s++; t=0; if(s==n){ cout<<i; break; } } } } for(int i=1;i<=n;i++) if(!f[i]) cout<<i; return 0; }