답안 #18893

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
18893 2016-02-16T11:52:10 Z chan492811 이상한 수열 (OJUZ10_bizarre) C++
100 / 100
10 ms 3232 KB
#include <cstdio>

int n,m;
int ip[50010];
bool arr[2000010];

int main(){
    int i,now=0,a;
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&ip[i]); ip[i]+=1000000;
        if(!arr[ip[i]]) now++; arr[ip[i]]=1;
    }
    scanf("%d",&m); now+=1000000;
    if(m<=n){ printf("%d",ip[m]-1000000); return 0; } m-=n+1;
    while(m && now<=2000005 && !arr[now]) now++,m--;
    if(now<=2000005) printf("%d",now-1000000);
    else printf("%d",now+m-1000000);
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 3232 KB Output is correct
2 Correct 0 ms 3232 KB Output is correct
3 Correct 0 ms 3232 KB Output is correct
4 Correct 0 ms 3232 KB Output is correct
5 Correct 0 ms 3232 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 3232 KB Output is correct
2 Correct 0 ms 3232 KB Output is correct
3 Correct 0 ms 3232 KB Output is correct
4 Correct 0 ms 3232 KB Output is correct
5 Correct 0 ms 3232 KB Output is correct
6 Correct 0 ms 3232 KB Output is correct
7 Correct 0 ms 3232 KB Output is correct
8 Correct 0 ms 3232 KB Output is correct
9 Correct 0 ms 3232 KB Output is correct
10 Correct 0 ms 3232 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 3232 KB Output is correct
2 Correct 7 ms 3232 KB Output is correct
3 Correct 4 ms 3232 KB Output is correct
4 Correct 5 ms 3232 KB Output is correct
5 Correct 10 ms 3232 KB Output is correct
6 Correct 7 ms 3232 KB Output is correct
7 Correct 0 ms 3232 KB Output is correct
8 Correct 9 ms 3232 KB Output is correct
9 Correct 2 ms 3232 KB Output is correct
10 Correct 7 ms 3232 KB Output is correct
11 Correct 7 ms 3232 KB Output is correct
12 Correct 4 ms 3232 KB Output is correct
13 Correct 6 ms 3232 KB Output is correct
14 Correct 0 ms 3232 KB Output is correct
15 Correct 2 ms 3232 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 3232 KB Output is correct
2 Correct 9 ms 3232 KB Output is correct
3 Correct 9 ms 3232 KB Output is correct
4 Correct 0 ms 3232 KB Output is correct
5 Correct 7 ms 3232 KB Output is correct
6 Correct 10 ms 3232 KB Output is correct
7 Correct 9 ms 3232 KB Output is correct
8 Correct 0 ms 3232 KB Output is correct
9 Correct 0 ms 3232 KB Output is correct
10 Correct 10 ms 3232 KB Output is correct
11 Correct 7 ms 3232 KB Output is correct
12 Correct 6 ms 3232 KB Output is correct
13 Correct 0 ms 3232 KB Output is correct
14 Correct 3 ms 3232 KB Output is correct
15 Correct 0 ms 3232 KB Output is correct