11584 | 2024-10-27 14:07:15 | balint | Felhasználónevek | python3 | Wrong answer 20/100 | 398ms | 20392 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()
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 16ms | 3128 KiB | ||||
2 | Accepted | 16ms | 3128 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 16ms | 3128 KiB | ||||
4 | Accepted | 14ms | 2952 KiB | ||||
subtask3 | 0/40 | ||||||
5 | Accepted | 16ms | 3032 KiB | ||||
6 | Accepted | 16ms | 3116 KiB | ||||
7 | Accepted | 16ms | 3116 KiB | ||||
8 | Accepted | 16ms | 3280 KiB | ||||
9 | Accepted | 16ms | 3128 KiB | ||||
10 | Accepted | 16ms | 3316 KiB | ||||
11 | Accepted | 16ms | 3128 KiB | ||||
12 | Accepted | 16ms | 3128 KiB | ||||
13 | Wrong answer | 16ms | 2988 KiB | ||||
14 | Wrong answer | 16ms | 2900 KiB | ||||
subtask4 | 0/40 | ||||||
15 | Accepted | 365ms | 20264 KiB | ||||
16 | Accepted | 365ms | 20224 KiB | ||||
17 | Accepted | 358ms | 20212 KiB | ||||
18 | Accepted | 370ms | 20192 KiB | ||||
19 | Accepted | 375ms | 20392 KiB | ||||
20 | Accepted | 397ms | 20392 KiB | ||||
21 | Accepted | 398ms | 20312 KiB | ||||
22 | Accepted | 381ms | 20380 KiB | ||||
23 | Wrong answer | 256ms | 6400 KiB | ||||
24 | Wrong answer | 254ms | 6400 KiB | ||||
25 | Wrong answer | 261ms | 6516 KiB | ||||
26 | Wrong answer | 254ms | 6404 KiB | ||||
27 | Accepted | 356ms | 20344 KiB |