#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 |
344 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
348 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
348 KB |
Output isn't correct |
5 |
Incorrect |
231 ms |
3488 KB |
Output isn't correct |
6 |
Incorrect |
214 ms |
3936 KB |
Output isn't correct |
7 |
Incorrect |
166 ms |
3316 KB |
Output isn't correct |
8 |
Incorrect |
179 ms |
3276 KB |
Output isn't correct |
9 |
Incorrect |
220 ms |
3468 KB |
Output isn't correct |
10 |
Incorrect |
187 ms |
3672 KB |
Output isn't correct |