Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
111538 | 石晋骁 | 猴子选大王 | C++ | Wrong Answer | 1 MS | 272 KB | 462 | 2025-03-02 15:24:27 |
#include<bits/stdc++.h> using namespace std; int n,m; int hz[1000]; int main(){ cin >> n >> m; int ren = 0; int bs = 0; int live = n; while(live != 1){ ren++; if(ren == n+1){ ren = 1; } if(hz[ren] == 1){ continue; } bs++; if(bs == m){ hz[ren] = 1; bs = 0; live--; } } for(int i = 0;i < n;i++){ if(hz[i] == 0){ cout << i+1; } } return 0; }
------Input------
226 188
------Answer-----
15
------Your output-----
116