Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
164886 袁昊贝 报数 C++ Accepted 1 MS 272 KB 434 2026-11-07 17:55:27

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){ 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; }