115852024-10-27 14:13:55balintFelhasználónevekpython3Wrong answer 20/100407ms20408 KiB
def main():
    username = input()
    length = len(username)
    takens = set()   
    for _ in range(int(input())):
        name = input()
        if len(name) == length:
            if name == username:
                takens.add(0)
        elif len(name) > length:
            if name[:length] == username:
                if name[length:].isdigit():
                    takens.add(int(name[length:]))

    i = 0
    while True:
        if i not in takens:
            if i == 0:
                print(username)
            else:
                print(username + str(i))
            return
        i+= 1
main()
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted16ms3128 KiB
2Accepted16ms2980 KiB
subtask220/20
3Accepted16ms3316 KiB
4Accepted16ms3036 KiB
subtask30/40
5Accepted17ms3128 KiB
6Accepted17ms3124 KiB
7Accepted17ms3004 KiB
8Accepted17ms3128 KiB
9Accepted16ms3016 KiB
10Accepted16ms3128 KiB
11Accepted17ms3320 KiB
12Accepted16ms3324 KiB
13Wrong answer16ms3312 KiB
14Wrong answer16ms3128 KiB
subtask40/40
15Accepted363ms20392 KiB
16Accepted372ms20276 KiB
17Accepted370ms20244 KiB
18Accepted370ms20408 KiB
19Accepted381ms20196 KiB
20Accepted407ms20256 KiB
21Accepted405ms20328 KiB
22Accepted388ms20388 KiB
23Wrong answer263ms6400 KiB
24Wrong answer263ms6400 KiB
25Wrong answer268ms6400 KiB
26Wrong answer259ms6400 KiB
27Wrong answer375ms20392 KiB