Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
104740 万隽宇 杀人游戏 C++ Wrong Answer 1 MS 268 KB 570 2025-01-09 19:26:41

Tests(0/5):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,m; bool a[101]={0}; cin>>n>>m; int s=0,t=0,c=0; while(s<n){ c+=1; if(c>n) c=1; if(!a[c]) t++; if(t==m){ t=0; cout<<c<<" "; a[c]=1; s++; } } return 0; }


Run Info:

------Input------
10 9
------Answer-----
9 8 10 2 5 3 4 1 6
------Your output-----
9 8 10 2 5 3 4 1 6 7