Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
41570 Songgy_King 报数模拟 C++ Accepted 0 MS 248 KB 359 2024-02-21 19:28:58

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main() { bool a[605]; int n,m,j=0,k; cin>>n>>m; k=n; for(int i=1;i<=n;i++){ a[i]=true; } while(1) { for(int i=1;i<=n;i++){ if(a[i]){ j++; if(j%3==0){ a[i]=false; j=0; k--; if(k==0){ cout<<i; return 0; } } } } } }


Judgement Protocol: