# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1112499 | vjudge1 | Baloni (COCI15_baloni) | C++17 | 169 ms | 3912 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 minimumArrows(vector<int>& hs) {
unordered_map<int, int> arrows;
int ac = 0;
for (int h : hs) {
if (arrows[h] > 0) {
arrows[h]--;
arrows[h - 1]++;
} else {
ac++;
arrows[h - 1]++;
}
}
return ac;
}
int main() {
int N;
cin >> N;
vector<int> hs(N);
for (int i = 0; i < N; i++) {
cin >> hs[i];
}
cout << minimumArrows(hs) << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |