Submission #1112546

#TimeUsernameProblemLanguageResultExecution timeMemory
1112546vjudge1Baloni (COCI15_baloni)C++17
0 / 100
2081 ms7424 KiB
#include<bits/stdc++.h> using namespace std; #define int long long int n; int ok=0; int dan(int a[]){ int ok=0; int sym=1; for(int i=0;i<n;i++){ if(a[i]!=0){ok=a[i]; break;} } for(int i=0;i<n;i++){ if(ok==a[i]){ a[i]=0; ok-=1; } } for(int i=0;i<n;i++){ if(a[i]!=0){ sym+=1; dan(a); } } return sym; } int32_t main() { cin>>n; int a[n]; for(int i=0;i<n;i++) cin>>a[i]; cout<<dan(a); }
#Verdict Execution timeMemoryGrader output
Fetching results...