Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
41576 DUANZHIBO 报数模拟 C++ Accepted 1 MS 244 KB 333 2024-02-21 19:30:36

Tests(1/1):


#include<iostream> using namespace std; int main() { bool a[605]; int n,j=0,k; cin>>n; 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){ j=0; k--; if(k==0){ cout<<i-1; return 0; } } } } } }


Judgement Protocol: