# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
113086 |
2019-05-23T14:43:25 Z |
CaQtiml |
Baloni (COCI15_baloni) |
C++14 |
|
188 ms |
460 KB |
#include "bits/stdc++.h"
using namespace std;
int arr[(int)1e6+10];
int ans=0;
int main()
{
int n;
cin >> n;
for(int i=1;i<=n;i++)
{
int op;
cin >> op;
if(!arr[op+1]) ans++;
else arr[op+1]--;
arr[op]++;
}
cout << ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
3 ms |
404 KB |
Output is correct |
3 |
Correct |
3 ms |
356 KB |
Output is correct |
4 |
Correct |
3 ms |
256 KB |
Output is correct |
5 |
Correct |
179 ms |
384 KB |
Output is correct |
6 |
Correct |
188 ms |
384 KB |
Output is correct |
7 |
Correct |
149 ms |
384 KB |
Output is correct |
8 |
Correct |
145 ms |
460 KB |
Output is correct |
9 |
Correct |
162 ms |
384 KB |
Output is correct |
10 |
Correct |
162 ms |
384 KB |
Output is correct |