# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
31642 | bolobalabr | Baloni (COCI15_baloni) | C++14 | 93 ms | 9988 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, dd[1000006], a[1000006], res(0);
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n;
fill(dd + 1, dd + 1000005, 0);
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i < n; i++)
{
if (dd[a[i] + 1] > 0) dd[a[i] + 1]--;
else res++;
dd[a[i]]++;
}
cout << res;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |