199632025-12-30 16:17:51beniFelhasználónevekpython3Wrong answer 0/100474ms35728 KiB
import sys
# sys.stdin = open('input.txt')
# sys.stdout = open('output.txt', 'w')
S = input().strip()
N = int(input().strip())

U = ["" for i in range(N)]
for i in range(N):
    U[i] = input().strip()

eredmeny = ""
U.sort()
hol = 0
if S in U:
    hol = U.index(S)
else:
    eredmeny = S

i = 0
print(U)
while eredmeny == "" and hol <= len(U)-1:
    i += 1
    hol += 1
    if hol == len(U)-1:
        eredmeny = S + str(i)
        break
    if U[hol] != S + str(i):
        eredmeny = S + str(i)
        break


print(eredmeny)
sys.stdout.close()
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer17ms3312 KiB
2Wrong answer16ms3124 KiB
subtask20/20
3Wrong answer16ms3124 KiB
4Runtime error16ms3048 KiB
subtask30/40
5Wrong answer16ms3124 KiB
6Wrong answer16ms3140 KiB
7Wrong answer16ms3128 KiB
8Wrong answer16ms2988 KiB
9Wrong answer17ms3132 KiB
10Wrong answer16ms3120 KiB
11Wrong answer16ms3128 KiB
12Wrong answer16ms2972 KiB
13Wrong answer17ms3124 KiB
14Wrong answer17ms3088 KiB
subtask40/40
15Wrong answer437ms35664 KiB
16Wrong answer460ms35728 KiB
17Wrong answer460ms35500 KiB
18Wrong answer423ms35644 KiB
19Wrong answer453ms35648 KiB
20Wrong answer474ms35504 KiB
21Wrong answer421ms35584 KiB
22Wrong answer421ms35572 KiB
23Wrong answer430ms26636 KiB
24Wrong answer433ms26868 KiB
25Wrong answer372ms26832 KiB
26Wrong answer382ms26136 KiB
27Wrong answer430ms35500 KiB