11583 | 2024-10-27 14:06:11 | balint | Felhasználónevek | python3 | Wrong answer 0/100 | 374ms | 20392 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()
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 14ms | 3128 KiB | ||||
2 | Wrong answer | 14ms | 3128 KiB | ||||
subtask2 | 0/20 | ||||||
3 | Accepted | 14ms | 3128 KiB | ||||
4 | Wrong answer | 14ms | 3128 KiB | ||||
subtask3 | 0/40 | ||||||
5 | Accepted | 17ms | 3060 KiB | ||||
6 | Wrong answer | 16ms | 3084 KiB | ||||
7 | Wrong answer | 16ms | 3120 KiB | ||||
8 | Wrong answer | 17ms | 3128 KiB | ||||
9 | Wrong answer | 16ms | 3116 KiB | ||||
10 | Wrong answer | 17ms | 3324 KiB | ||||
11 | Wrong answer | 16ms | 3020 KiB | ||||
12 | Wrong answer | 17ms | 3300 KiB | ||||
13 | Wrong answer | 16ms | 3128 KiB | ||||
14 | Wrong answer | 16ms | 3164 KiB | ||||
subtask4 | 0/40 | ||||||
15 | Accepted | 374ms | 20392 KiB | ||||
16 | Wrong answer | 356ms | 20392 KiB | ||||
17 | Wrong answer | 358ms | 20168 KiB | ||||
18 | Wrong answer | 370ms | 20388 KiB | ||||
19 | Wrong answer | 363ms | 20392 KiB | ||||
20 | Wrong answer | 360ms | 20392 KiB | ||||
21 | Wrong answer | 358ms | 20392 KiB | ||||
22 | Wrong answer | 363ms | 20392 KiB | ||||
23 | Wrong answer | 257ms | 8840 KiB | ||||
24 | Wrong answer | 256ms | 8948 KiB | ||||
25 | Wrong answer | 259ms | 8888 KiB | ||||
26 | Wrong answer | 254ms | 8604 KiB | ||||
27 | Accepted | 361ms | 20256 KiB |