답안 #851581

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
851581 2023-09-20T07:37:06 Z Aplace 이상한 수열 (OJUZ10_bizarre) PyPy
0 / 100
43 ms 30544 KB
N = int(input())
L_S = list(map(int, input().split()))
M = int(input())

if M <= len(L_S):
    print(L_S[M - 1])

else:
    S = list(set(L_S))
    diff = len(S)

    if diff in S:
        print(diff)

    else:
        S.append(0x7FFFFFFF)    # Max
        S.append(diff)          # Now
        S.sort()

        inserted = S.index(diff)   # N+1
        End = S[inserted + 1]

        print(min(M - (N + 1 - diff), End))
# 결과 실행 시간 메모리 Grader output
1 Runtime error 25 ms 20028 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 21 ms 19260 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 23 ms 21300 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 43 ms 30544 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -