#include <iostream>
using namespace std;
int n,i,j,x,sol;
int f[1000010];
int main (){
cin>>n;
for (i=1;i<=n;i++){
cin>>x;
if (f[x+1]){
f[x+1] = 0;
f[x] = 1;
} else {
sol++;
f[x] = 1;
}}
cout<<sol;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Incorrect |
3 ms |
248 KB |
Output isn't correct |
3 |
Incorrect |
3 ms |
376 KB |
Output isn't correct |
4 |
Incorrect |
4 ms |
376 KB |
Output isn't correct |
5 |
Incorrect |
334 ms |
3932 KB |
Output isn't correct |
6 |
Incorrect |
343 ms |
3812 KB |
Output isn't correct |
7 |
Incorrect |
275 ms |
3292 KB |
Output isn't correct |
8 |
Incorrect |
279 ms |
3064 KB |
Output isn't correct |
9 |
Incorrect |
311 ms |
3548 KB |
Output isn't correct |
10 |
Incorrect |
304 ms |
3548 KB |
Output isn't correct |