#include <bits/stdc++.h>
using namespace std;
void solve(){
int n; cin>>n;
int xd[n];
map <int,int> lol;
for (int i=0;i<n;i++){
cin>>xd[i];
lol[xd[i]]++;
}
int ans=0;
for (int i=0;i<n;i++){
if(lol[xd[i]-1]==0) ans++;
lol[xd[i]]--;
}
cout<<ans;
}
int main() {
int t; t=1;
while(t--){
solve();
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
348 KB |
Output isn't correct |
5 |
Incorrect |
225 ms |
3636 KB |
Output isn't correct |
6 |
Incorrect |
217 ms |
3928 KB |
Output isn't correct |
7 |
Incorrect |
199 ms |
3160 KB |
Output isn't correct |
8 |
Incorrect |
165 ms |
3296 KB |
Output isn't correct |
9 |
Incorrect |
196 ms |
3416 KB |
Output isn't correct |
10 |
Incorrect |
193 ms |
3416 KB |
Output isn't correct |