Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
113045 | 李佳璟 | 猴子选大王 | C++ | Accepted | 1 MS | 276 KB | 343 | 2025-03-15 11:22:17 |
#include<bits/stdc++.h> using namespace std; int N,M; int ren=0,bs=0; int live=0; int die[1001]; int main() { cin>>N>>M; live=N+1; while(live!=1){ ren++; if(ren>N){ ren = 1; } if(die[ren]==1){ continue; } bs++; if(bs==M){ die[ren] = 1; bs=0; live--; } } cout<<ren; return 0; }