Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
95987 只因你太美(Ikun 真爱粉) 猴子选大王 C++ Accepted 1 MS 272 KB 581 2024-11-02 16:55:39

Tests(10/10):


Code:

#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; bool a[10001]; int main(){ int n,m; cin>>n>>m; int q=0,p=0,f=0; while(f!=n-1){ p++; if(p>n) p=1; if(!a[p]) q++; if(q==m){ a[p]=1; f++; q=0; } } for(int i=1;i<=n;i++){ if(a[i]==0)cout<<i; } cout<<endl; return 0; }