Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
104788 黄梓皓 杀人游戏 C++ Compile Error 0 MS 0 KB 260 2025-01-11 11:51:13

Tests(0/0):


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; }


Run Info:

Main.cc:1:25: warning: extra tokens at end of #include directive
 #include 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; }
                         ^
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status