# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1112546 | vjudge1 | Baloni (COCI15_baloni) | C++17 | 2081 ms | 7424 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |