# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
639701 | classic | Baloni (COCI15_baloni) | C++14 | 62 ms | 11144 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() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<int> h(n);
vector<int> cnt(1e6 + 1);
int res = 0;
for (int i = 0; i < n; i++) {
int h;
cin >> h;
if (!cnt[h]) {
res += 1;
} else {
cnt[h] -= 1;
}
cnt[h - 1] += 1;
}
cout << res;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |