115832024-10-27 14:06:11balintFelhasználónevekpython3Wrong answer 0/100374ms20392 KiB
def main():
    username = input()
    length = len(username)
    nums = set()   
    default_taken = False
    for _ in range(int(input())):
        if (name:= input())[:length] == username and name[length:].isdigit():
            if len(name) == length:
                default_taken = True
            else:
                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
1Accepted14ms3128 KiB
2Wrong answer14ms3128 KiB
subtask20/20
3Accepted14ms3128 KiB
4Wrong answer14ms3128 KiB
subtask30/40
5Accepted17ms3060 KiB
6Wrong answer16ms3084 KiB
7Wrong answer16ms3120 KiB
8Wrong answer17ms3128 KiB
9Wrong answer16ms3116 KiB
10Wrong answer17ms3324 KiB
11Wrong answer16ms3020 KiB
12Wrong answer17ms3300 KiB
13Wrong answer16ms3128 KiB
14Wrong answer16ms3164 KiB
subtask40/40
15Accepted374ms20392 KiB
16Wrong answer356ms20392 KiB
17Wrong answer358ms20168 KiB
18Wrong answer370ms20388 KiB
19Wrong answer363ms20392 KiB
20Wrong answer360ms20392 KiB
21Wrong answer358ms20392 KiB
22Wrong answer363ms20392 KiB
23Wrong answer257ms8840 KiB
24Wrong answer256ms8948 KiB
25Wrong answer259ms8888 KiB
26Wrong answer254ms8604 KiB
27Accepted361ms20256 KiB