#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]) r++,d[x-1]=1;
else d[x]--,d[x-1]++;
}
cout<<r;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
2 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
3 |
Incorrect |
5 ms |
460 KB |
Output isn't correct |
4 |
Incorrect |
4 ms |
384 KB |
Output isn't correct |
5 |
Incorrect |
222 ms |
376 KB |
Output isn't correct |
6 |
Incorrect |
242 ms |
384 KB |
Output isn't correct |
7 |
Incorrect |
177 ms |
384 KB |
Output isn't correct |
8 |
Incorrect |
157 ms |
504 KB |
Output isn't correct |
9 |
Incorrect |
175 ms |
384 KB |
Output isn't correct |
10 |
Incorrect |
205 ms |
376 KB |
Output isn't correct |