| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 76722 | 彭林江 | 环形密码 | C++ | Wrong Answer | 0 MS | 264 KB | 537 | 2024-06-02 16:57:52 |
#include<bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; int die[n+1] = {0}; // 一开始所有人都活着。设为0 int mima[n+1]; for(int i = 1; i <= n; i++){ cin >> mima[i]; } int sr = 0;// int ren = 0, bao = 0; // while(sr != n){ // 必须杀完n-1人 ren++; if(ren > n){ ren = 1; } if(die[ren] == 0){ bao++; if(bao == m){ cout << ren << " "; die[ren] = 1; // 出局 bao = 0; sr++; m=mima[ren]; } } } return 0; }
------Input------
10 3 8 3 6 3 4 10 3 10 3 2
------Answer-----
6 3 3 10 8 3 3 2 10 4
------Your output-----
3 9 2 6 1 7 4 10 8 5