Run ID:32709

提交时间:2022-07-26 12:09:00

#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; }