Submission #851582

#TimeUsernameProblemLanguageResultExecution timeMemory
851582Aplace이상한 수열 (OJUZ10_bizarre)Pypy 3
100 / 100
45 ms27088 KiB
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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...