#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define all(x) (x).begin(), (x).end()
const int mxh = 1e6 + 10;
int cnt[mxh];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
int ans = 0;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
if (!cnt[x]) ans++;
cnt[x - 1]++;
}
cout << ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
5 |
Incorrect |
41 ms |
348 KB |
Output isn't correct |
6 |
Incorrect |
42 ms |
348 KB |
Output isn't correct |
7 |
Incorrect |
34 ms |
464 KB |
Output isn't correct |
8 |
Incorrect |
34 ms |
468 KB |
Output isn't correct |
9 |
Incorrect |
38 ms |
348 KB |
Output isn't correct |
10 |
Incorrect |
37 ms |
344 KB |
Output isn't correct |