# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
541724 | daristyle | Baloni (COCI15_baloni) | C++11 | 2093 ms | 4484 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;
int main()
{
int n, arrows=0, mx=0, r=0, h;
cin>>n;
int v[n];
for(int i=1; i<=n; ++i){
cin>>v[i];
if(mx<v[i]) mx=v[i];
}
while(r!=n){
h=mx;
mx=0;
arrows++;
for(int i=1; i<=n && h; ++i){
if(v[i]==h){
v[i]=0;
h--;
r++;
}
if(v[i]>mx) mx=v[i];
}
}
cout<<arrows;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |