# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
229420 | DodgeBallMan | Baloni (COCI15_baloni) | C++14 | 122 ms | 7332 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;
const int N = 1e6 + 10;
int n, h[N], arrow[N], tot = 0;
int main()
{
scanf("%d",&n);
for ( int i = 1 ; i <= n ; i++ ){
scanf("%d",&h[i]);
if( !arrow[h[i]] ) {
tot++;
arrow[h[i]-1]++;
}
else {
arrow[h[i]]--;
arrow[h[i]-1]++;
}
}
printf("%d",tot);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |