Run ID:128790

提交时间:2025-08-19 17:02:23

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