Submission #30649

# Submission time Handle Problem Language Result Execution time Memory
30649 2017-07-26T01:44:30 Z TAMREF 이상한 수열 (OJUZ10_bizarre) C++11
100 / 100
13 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;
    if(u>S[u-1]) return !printf("%d\n",u+M-N-1);
    return !printf("%d\n",min(u+M-N-1,*lower_bound(S,S+u,u)));
}
# Verdict Execution time Memory 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
# Verdict Execution time Memory 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
# Verdict Execution time Memory Grader output
1 Correct 3 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 9 ms 2376 KB Output is correct
5 Correct 3 ms 2376 KB Output is correct
6 Correct 0 ms 2376 KB Output is correct
7 Correct 3 ms 2376 KB Output is correct
8 Correct 3 ms 2376 KB Output is correct
9 Correct 9 ms 2376 KB Output is correct
10 Correct 0 ms 2376 KB Output is correct
11 Correct 13 ms 2376 KB Output is correct
12 Correct 6 ms 2376 KB Output is correct
13 Correct 6 ms 2376 KB Output is correct
14 Correct 0 ms 2376 KB Output is correct
15 Correct 3 ms 2376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2376 KB Output is correct
2 Correct 9 ms 2376 KB Output is correct
3 Correct 0 ms 2376 KB Output is correct
4 Correct 9 ms 2376 KB Output is correct
5 Correct 6 ms 2376 KB Output is correct
6 Correct 9 ms 2376 KB Output is correct
7 Correct 6 ms 2376 KB Output is correct
8 Correct 6 ms 2376 KB Output is correct
9 Correct 6 ms 2376 KB Output is correct
10 Correct 3 ms 2376 KB Output is correct
11 Correct 0 ms 2376 KB Output is correct
12 Correct 9 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 0 ms 2376 KB Output is correct