Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
164884 郦辰希 报数 C++ Accepted 1 MS 268 KB 400 2026-11-07 17:55:01

Tests(1/1):


Code:

#include <bits/stdc++.h> using namespace std; int a[10001]{}; int main(){ int n; cin>>n; int pe=n; int i=0,num=0; while(pe>0){ i++; if(i>n) i=1; if(a[i]==0){ num++; if(num==3){ a[i]=1; num=0; pe--; } } } cout<<i<<endl; return 0; }