# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
383753 |
2021-03-30T19:06:21 Z |
Alma |
Baloni (COCI15_baloni) |
C++14 |
|
3 ms |
1900 KB |
#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(1e3+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 |
1 |
Correct |
1 ms |
1004 KB |
Output is correct |
2 |
Correct |
2 ms |
1004 KB |
Output is correct |
3 |
Correct |
2 ms |
1004 KB |
Output is correct |
4 |
Correct |
2 ms |
1004 KB |
Output is correct |
5 |
Runtime error |
3 ms |
1900 KB |
Execution killed with signal 11 |
6 |
Runtime error |
3 ms |
1900 KB |
Execution killed with signal 11 |
7 |
Runtime error |
3 ms |
1900 KB |
Execution killed with signal 11 |
8 |
Runtime error |
3 ms |
1900 KB |
Execution killed with signal 11 |
9 |
Runtime error |
3 ms |
1900 KB |
Execution killed with signal 11 |
10 |
Runtime error |
3 ms |
1900 KB |
Execution killed with signal 11 |