# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
383755 | Alma | Baloni (COCI15_baloni) | C++14 | 93 ms | 10604 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(NULL);
int n, h, t = 0;
vector<stack<int>> vs(1e4+2, stack<int>());
cin >> n;
while (n--) {
cin >> h;
if (vs[h+1].empty())
t++;
else
vs[h+1].pop();
vs[h].push(h);
}
cout << t << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |