Submission #851581

# Submission time Handle Problem Language Result Execution time Memory
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))
# Verdict Execution time Memory Grader output
1 Runtime error 25 ms 20028 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 21 ms 19260 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 23 ms 21300 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 43 ms 30544 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -