#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;
for(int i=1;i<=n;++i)
{
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 |
2 ms |
256 KB |
Output isn't correct |
2 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
3 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
4 |
Incorrect |
4 ms |
384 KB |
Output isn't correct |
5 |
Incorrect |
196 ms |
4060 KB |
Output isn't correct |
6 |
Incorrect |
211 ms |
3804 KB |
Output isn't correct |
7 |
Incorrect |
209 ms |
3168 KB |
Output isn't correct |
8 |
Incorrect |
226 ms |
3164 KB |
Output isn't correct |
9 |
Incorrect |
201 ms |
3576 KB |
Output isn't correct |
10 |
Incorrect |
196 ms |
3448 KB |
Output isn't correct |