Run ID:155757
提交时间:2026-06-13 11:27:26
#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,w=0,s=0,b=0; cin>>n>>m; bool a[300]={0}; while(s!=n-1){ w++; if(w>n)w=1; if(!a[w])b++; if(b==m){ b=0; s++; a[w]=1; } } for(int i=1;i<=n;i++){ if(a[i]==0) cout<<i; } return 0; }