Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
141560 熊婉月 猴子选大王 C++ 解答错误 28 39 MS 4152 KB 316 2024-04-06 08:22:13

Tests(2/7):


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


测评信息: