Submission #1112520

#TimeUsernameProblemLanguageResultExecution timeMemory
1112520vjudge1Baloni (COCI15_baloni)C++17
0 / 100
2072 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=0; 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)+1; }
#Verdict Execution timeMemoryGrader output
Fetching results...