답안 #30650

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
30650 2017-07-26T01:50:52 Z TAMREF 이상한 수열 (OJUZ10_bizarre) C++11
100 / 100
9 ms 2376 KB
#include <bits/stdc++.h>
using namespace std;
int N,M,u;
int S[50005];
int main(){
    cin.sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cin>>N;
    for(int i=0;i<N;i++) cin>>S[i];
    cin>>M;
    if(M<=N) return !printf("%d\n",S[M-1]);
    sort(S,S+N);
    u=unique(S,S+N)-S; S[u]=2e9;
    return !printf("%d\n",min(u+M-N-1,*lower_bound(S,S+u,u)));
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2376 KB Output is correct
2 Correct 0 ms 2376 KB Output is correct
3 Correct 0 ms 2376 KB Output is correct
4 Correct 0 ms 2376 KB Output is correct
5 Correct 0 ms 2376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2376 KB Output is correct
2 Correct 0 ms 2376 KB Output is correct
3 Correct 0 ms 2376 KB Output is correct
4 Correct 0 ms 2376 KB Output is correct
5 Correct 0 ms 2376 KB Output is correct
6 Correct 0 ms 2376 KB Output is correct
7 Correct 0 ms 2376 KB Output is correct
8 Correct 0 ms 2376 KB Output is correct
9 Correct 0 ms 2376 KB Output is correct
10 Correct 0 ms 2376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 2376 KB Output is correct
2 Correct 3 ms 2376 KB Output is correct
3 Correct 6 ms 2376 KB Output is correct
4 Correct 0 ms 2376 KB Output is correct
5 Correct 0 ms 2376 KB Output is correct
6 Correct 6 ms 2376 KB Output is correct
7 Correct 0 ms 2376 KB Output is correct
8 Correct 6 ms 2376 KB Output is correct
9 Correct 9 ms 2376 KB Output is correct
10 Correct 6 ms 2376 KB Output is correct
11 Correct 6 ms 2376 KB Output is correct
12 Correct 3 ms 2376 KB Output is correct
13 Correct 3 ms 2376 KB Output is correct
14 Correct 3 ms 2376 KB Output is correct
15 Correct 9 ms 2376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 2376 KB Output is correct
2 Correct 9 ms 2376 KB Output is correct
3 Correct 9 ms 2376 KB Output is correct
4 Correct 3 ms 2376 KB Output is correct
5 Correct 3 ms 2376 KB Output is correct
6 Correct 9 ms 2376 KB Output is correct
7 Correct 0 ms 2376 KB Output is correct
8 Correct 6 ms 2376 KB Output is correct
9 Correct 0 ms 2376 KB Output is correct
10 Correct 9 ms 2376 KB Output is correct
11 Correct 6 ms 2376 KB Output is correct
12 Correct 3 ms 2376 KB Output is correct
13 Correct 3 ms 2376 KB Output is correct
14 Correct 9 ms 2376 KB Output is correct
15 Correct 9 ms 2376 KB Output is correct