Run ID:111525
提交时间:2025-03-02 15:19:16
#include<bits/stdc++.h> using namespace std; int n,m; int hz[3000]; int main(){ cin>>n>>m; int ren=1; int bs=1; int live=n; while(live!=1){ ren++; if(ren==n+1){ ren=1; } if(hz[ren]==1){ continue; } bs++; if(bs==m){ hz[ren]=1; cout<<ren<<" "; bs=0; live--; } } return 0; }