Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
164916 李沐阳 猴子选大王 C++ Accepted 1 MS 268 KB 337 2026-11-08 09:19:06

Tests(10/10):


Code:

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