Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
41518 Andrew宥杨 报数模拟 C++ Runtime Error 0 MS 244 KB 306 2024-02-21 18:17:12

Tests(0/1):


#include<bits/stdc++.h> using namespace std; int main(){ int a,cnt=0,j=0; cin>>a; int k=a; int b[a+1]; for(int i=1;i<=a;i++) b[i]=1; while(k){ if(cnt!=3)cnt++; if(cnt==3){ b[j]=0; k--; cnt=0; } j++; } for(int i=1;i<=a;i++){ if(b[i]) cout<<i; } return 0; }


Judgement Protocol: