#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e6+10;
int n,x,d[N],r;
int main()
{
cin>>n;
while(n--)
{
cin>>x;
if(!d[x+1]) r++,d[x]=1;
else d[x+1]--,d[x]++;
}
cout<<r;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
3 |
Incorrect |
3 ms |
256 KB |
Output isn't correct |
4 |
Incorrect |
3 ms |
252 KB |
Output isn't correct |
5 |
Incorrect |
193 ms |
504 KB |
Output isn't correct |
6 |
Incorrect |
286 ms |
504 KB |
Output isn't correct |
7 |
Incorrect |
175 ms |
504 KB |
Output isn't correct |
8 |
Incorrect |
182 ms |
384 KB |
Output isn't correct |
9 |
Incorrect |
211 ms |
256 KB |
Output isn't correct |
10 |
Incorrect |
222 ms |
376 KB |
Output isn't correct |