# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
113085 |
2019-05-23T14:40:59 Z |
CaQtiml |
Baloni (COCI15_baloni) |
C++14 |
|
190 ms |
3972 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]) ans++;
else arr[op]--;
arr[op-1]++;
}
cout << ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
368 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
3 ms |
384 KB |
Output is correct |
4 |
Correct |
3 ms |
420 KB |
Output is correct |
5 |
Correct |
186 ms |
3972 KB |
Output is correct |
6 |
Correct |
190 ms |
3948 KB |
Output is correct |
7 |
Correct |
153 ms |
3196 KB |
Output is correct |
8 |
Correct |
151 ms |
3196 KB |
Output is correct |
9 |
Correct |
172 ms |
3592 KB |
Output is correct |
10 |
Correct |
169 ms |
3456 KB |
Output is correct |