# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
231184 | palpatinezw | Baloni (COCI15_baloni) | C++14 | 363 ms | 10360 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;
#define int long long
int N, h[1000005];
multiset<int> s;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> N;
for (int i = 0; i < N; i++) {
cin >> h[i];
}
int c = 0;
for (int i = 0; i < N; i++) {
if (s.find(h[i] + 1) == s.end()) c++;
else s.erase(s.find(h[i] + 1));
s.insert(h[i]);
}
cout << c;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |