Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
110434 万隽宇 猴子选大王 C++ Wrong Answer 1 MS 272 KB 701 2025-02-20 19:12:40

Tests(0/10):


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,a=0; cin>>n>>m; int b[n+1]; for(int i=0;i<=n+1;i++){ b[i]=0; } for(int i=1;i<=n-1;i++){ for(int j=0;j<m;j++){ a++; if(b[a]==1){ a++; } if(a>n){ a%=n; } } b[a]=1; } for(int i=1;i<n+1;i++){ if(b[i]==0){ cout<<i; } } return 0; }


Run Info:

------Input------
226 188
------Answer-----
15
------Your output-----
1234567910111213141617182021222326282931323536373940414345464849505253545657586061626364656668697071727378798081828384858788899091929394979899100101102103104106108109110111112114115116117120121122123124125126127128129131132133134135137138139140141143145146147148149151152153154155156157159160161162163164165167169170171172173175176177178179180181182183184185186187190191193194195196197198199200202203204205207208209210211212213214215216217219220221222224225226