Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
76653 胡盛哲 杀人游戏 C++ Accepted 1 MS 272 KB 334 2024-06-02 16:23:58

Tests(5/5):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; int d[n+1] = {0}; int s = 0; int r = 0,b = 0; while(s != n-1){ r++; if(r > n){ r = 1; } if(d[r] == 0){ b++; if(b == m){ cout << r << " "; d[r] = 1; b = 0; s++; } } } return 0; }