#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]) v[x-1]--;
else nr++;
v[x]++;
}
cout<<nr;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
312 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
308 KB |
Output isn't correct |
5 |
Incorrect |
177 ms |
212 KB |
Output isn't correct |
6 |
Incorrect |
173 ms |
212 KB |
Output isn't correct |
7 |
Incorrect |
147 ms |
212 KB |
Output isn't correct |
8 |
Incorrect |
139 ms |
284 KB |
Output isn't correct |
9 |
Incorrect |
160 ms |
292 KB |
Output isn't correct |
10 |
Incorrect |
188 ms |
300 KB |
Output isn't correct |