Submission #30864

#TimeUsernameProblemLanguageResultExecution timeMemory
30864leejseo이상한 수열 (OJUZ10_bizarre)Cpython 2
0 / 100
285 ms3 KiB
def main(): n = int(raw_input()) s = map(int, raw_input().split()) m = int(raw_input()) s.sort() if m <= n: print s[m-1] return L = [] for i in range(n): if s[i] not in L: L.append(s[i]) c = len(L) index = n for i in range(n): if c <= s[i]: index = i if index == n: print c + m-(n+1) return diff = s[index] - c if m - (n+1) > diff: print s[index] return print c + m-(n+1) return main()
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...