#include <iostream>
using namespace std;
const int N=1e6;
int v[N+5];
int main()
{
int n; cin>>n;
int nr=1;
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 |
212 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
212 KB |
Output isn't correct |
5 |
Incorrect |
163 ms |
296 KB |
Output isn't correct |
6 |
Incorrect |
168 ms |
212 KB |
Output isn't correct |
7 |
Incorrect |
145 ms |
380 KB |
Output isn't correct |
8 |
Incorrect |
138 ms |
212 KB |
Output isn't correct |
9 |
Incorrect |
150 ms |
288 KB |
Output isn't correct |
10 |
Incorrect |
150 ms |
288 KB |
Output isn't correct |