#include <iostream>
using namespace std;
const int N=1e6;
int v[N+5];
int main(){
int n; cin>>n;
int nr=0;
for(int i=1;i<=n;i++){
int x;cin>>x;
if(v[x+1]==1){
v[x+1]--;
}
else nr++;
v[x]++;
}
cout<<nr;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
504 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
5 |
Incorrect |
128 ms |
4012 KB |
Output isn't correct |
6 |
Incorrect |
129 ms |
3856 KB |
Output isn't correct |
7 |
Incorrect |
122 ms |
3156 KB |
Output isn't correct |
8 |
Incorrect |
111 ms |
3156 KB |
Output isn't correct |
9 |
Incorrect |
115 ms |
3408 KB |
Output isn't correct |
10 |
Incorrect |
115 ms |
3408 KB |
Output isn't correct |