Run ID:111551

提交时间:2025-03-02 15:29:45

#include<bits/stdc++.h> using namespace std; int n,m; int hz[1000]; int main(){ cin >> n >> m; int ren = 0; int bs = 0; 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; bs = 0; live--; } } for(int i = 1;i <= n;i++){ if(hz[i] == 0){ cout << i; } } return 0; }