Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
42203 jiabokai 选猴王 C++ 解答错误 1 MS 240 KB 335 2024-02-24 12:09:28

Tests(0/1):


#include<bits/stdc++.h> using namespace std; int main() { int n,m,p=0,cnt=0,i=0; while(cin>>n>>m&&n&&m){ bool s[300]={true}; while(cnt>0){ p++; if(p==m){ cnt--; s[i]=false; } i++; i%=n; } for(int i=0;i<n;i++){ if(s[i]==true){ cout<<i+1<<endl; } } } return 0; }


测评信息: