Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
110435 | 万隽宇 | 猴子选大王 | C++ | Accepted | 1 MS | 272 KB | 652 | 2025-02-20 19:30:46 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,m,a=0,c=0,t=0,d=0; cin>>n>>m; int b[n+1]; for(int i=0;i<=n+1;i++){ b[i]=0; } while(d!=n-1){ a++; if(a>n) a=1; if(b[a]!=1) t++; if(t==m){ t=0; b[a]=1; d++; } } for(int i=1;i<n+1;i++){ if(b[i]==0){ cout<<i; } } return 0; }