# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
956300 | Ariadna | Baloni (COCI15_baloni) | C++14 | 181 ms | 14372 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() {
int n;
cin >> n;
vector<int> h(n);
for (int i = 0; i < n; ++i) cin >> h[i];
unordered_map<int, int> m;
m.reserve(n);
int arrows = 0;
for (int i = 0; i < n; ++i) {
++m[h[i]];
if (m[h[i]+1] > 0) {
--m[h[i]+1];
continue;
}
++arrows;
}
cout << arrows << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |