#include <iostream>
using namespace std;
int n,i,sol,v[1000010],f[1000010];
int main() {
cin>>n;
for (i=1;i<=n;i++)
cin>>v[i];
for (i=1;i<=n;i++) {
if (f[v[i]]==0) {
sol++;
f[v[i]-1]=1;
}
else
f[v[i]-1]=1;
}
cout<<sol;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
376 KB |
Output isn't correct |
2 |
Incorrect |
3 ms |
376 KB |
Output isn't correct |
3 |
Incorrect |
4 ms |
376 KB |
Output isn't correct |
4 |
Incorrect |
4 ms |
376 KB |
Output isn't correct |
5 |
Incorrect |
338 ms |
3452 KB |
Output isn't correct |
6 |
Incorrect |
367 ms |
3796 KB |
Output isn't correct |
7 |
Incorrect |
320 ms |
3144 KB |
Output isn't correct |
8 |
Incorrect |
269 ms |
3296 KB |
Output isn't correct |
9 |
Incorrect |
321 ms |
3256 KB |
Output isn't correct |
10 |
Incorrect |
302 ms |
3448 KB |
Output isn't correct |