Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
146691 李朋秦 猴子选大王 C++ Accepted 3 MS 272 KB 321 2026-01-29 16:01:01

Tests(10/10):


Code:

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