# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
153884 | vladciuperceanu | Baloni (COCI15_baloni) | C++14 | 340 ms | 376 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 <iostream>
using namespace std;
int n,i,x,f[1000005];
int main()
{
cin >> n; int sol = 0;
for (i=1; i<=n; i++)
{
cin >> x;
if (f[x+1] == 0)
sol++;
else
if (f[x] > f[x+1])
sol++;
f[x] = i;
}
cout << sol;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |