# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1112474 | vjudge1 | Baloni (COCI15_baloni) | C++98 | 140 ms | 3896 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 <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> heights(N);
for (int i = 0; i < N; ++i) {
cin >> heights[i];
}
unordered_map<int, int> arrows;
int num_arrows = 0;
for (int i = 0; i < N; ++i) {
int h = heights[i];
if (arrows[h] > 0) {
arrows[h]--;
arrows[h - 1]++;
} else {
num_arrows++;
arrows[h - 1]++;
}
}
cout << num_arrows << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |