# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1112415 | vjudge1 | Baloni (COCI15_baloni) | C++17 | 1878 ms | 3896 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 n,h[1000000],counter;
inline void arrow(int height,int index)
{
counter++;
for (int i = index; height>0 && i<n; i++)
{
if(h[i]==height)
{
height--;
h[i] = 0;
}
}
}
int main()
{
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> h[i];
}
for (int i = 0; i < n; i++)
{
if(h[i])
{
arrow(h[i],i);
}
}
cout << counter;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |