Run ID:113035

提交时间:2025-03-15 11:10:52

#include<bits/stdc++.h> using namespace std; int N,M; int ren=0,bs=0; int live=0; int die[1001]; int main() { cin>>N>>M; live=N; while(live!=1){ ren++; if(ren>N){ ren = 1; } if(die[ren]==1){ continue; } bs++; if(bs==M){ cout<<ren<<" "; die[ren] = 1; bs=0; live--; } } return 0; }