#include <iostream>
#include <algorithm>
using namespace std;
int n,v[1000010],f[1000010],sum,of;
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>v[i];
}
for(int i=1;i<=n;i++){
if(f[v[i]]>=0)
of++;
else
f[v[i]]--;
f[v[i]-1]++;
}
cout<<of;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
376 KB |
Output isn't correct |
2 |
Incorrect |
3 ms |
376 KB |
Output isn't correct |
3 |
Incorrect |
3 ms |
376 KB |
Output isn't correct |
4 |
Incorrect |
13 ms |
376 KB |
Output isn't correct |
5 |
Incorrect |
337 ms |
6416 KB |
Output isn't correct |
6 |
Incorrect |
343 ms |
6756 KB |
Output isn't correct |
7 |
Incorrect |
273 ms |
5420 KB |
Output isn't correct |
8 |
Incorrect |
274 ms |
5308 KB |
Output isn't correct |
9 |
Incorrect |
308 ms |
5892 KB |
Output isn't correct |
10 |
Incorrect |
306 ms |
5888 KB |
Output isn't correct |