Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
164914 孔声豪 猴子选大王 C++ Time Limit Exceeded 1000 MS 268 KB 243 2026-11-08 09:12:49

Tests(0/10):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n,sr=0,m; bool j[101]={0}; cin>>n>>m; int i=0,bs=0; while(sr!=n){ i++; if(i>n)i=1; if(!j[i])bs++; if(bs==m){ bs=0; j[i]=true; sr++; } } cout<<i; return 0; }