115842024-10-27 14:07:15balintFelhasználónevekpython3Wrong answer 20/100398ms20392 KiB
def main():
    username = input()
    length = len(username)
    nums = set()   
    default_taken = False
    for _ in range(int(input())):
        if (name:= input())[:length] == username:
            if len(name) == length:
                default_taken = True
            elif name[length:].isdigit():
                nums.add(int(name[length:]))

    if not default_taken:
        print(username)
        return
    i = 1
    while True:
        if i not in nums:
            print(username + str(i))
            return
        i+= 1
main()
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted16ms3128 KiB
2Accepted16ms3128 KiB
subtask220/20
3Accepted16ms3128 KiB
4Accepted14ms2952 KiB
subtask30/40
5Accepted16ms3032 KiB
6Accepted16ms3116 KiB
7Accepted16ms3116 KiB
8Accepted16ms3280 KiB
9Accepted16ms3128 KiB
10Accepted16ms3316 KiB
11Accepted16ms3128 KiB
12Accepted16ms3128 KiB
13Wrong answer16ms2988 KiB
14Wrong answer16ms2900 KiB
subtask40/40
15Accepted365ms20264 KiB
16Accepted365ms20224 KiB
17Accepted358ms20212 KiB
18Accepted370ms20192 KiB
19Accepted375ms20392 KiB
20Accepted397ms20392 KiB
21Accepted398ms20312 KiB
22Accepted381ms20380 KiB
23Wrong answer256ms6400 KiB
24Wrong answer254ms6400 KiB
25Wrong answer261ms6516 KiB
26Wrong answer254ms6404 KiB
27Accepted356ms20344 KiB