11582 | 2024-10-27 14:01:17 | balint | Felhasználónevek | python3 | Runtime error 20/100 | 372ms | 23748 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) == len(username):
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 | 16ms | 3064 KiB | ||||
2 | Accepted | 16ms | 3128 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 14ms | 3056 KiB | ||||
4 | Accepted | 16ms | 3128 KiB | ||||
subtask3 | 0/40 | ||||||
5 | Accepted | 17ms | 3128 KiB | ||||
6 | Accepted | 14ms | 3132 KiB | ||||
7 | Accepted | 16ms | 3124 KiB | ||||
8 | Accepted | 16ms | 3128 KiB | ||||
9 | Accepted | 16ms | 3344 KiB | ||||
10 | Accepted | 17ms | 3128 KiB | ||||
11 | Accepted | 16ms | 3128 KiB | ||||
12 | Accepted | 16ms | 3060 KiB | ||||
13 | Runtime error | 16ms | 3104 KiB | ||||
14 | Runtime error | 14ms | 3136 KiB | ||||
subtask4 | 0/40 | ||||||
15 | Accepted | 328ms | 23728 KiB | ||||
16 | Accepted | 335ms | 23716 KiB | ||||
17 | Accepted | 330ms | 23748 KiB | ||||
18 | Accepted | 349ms | 23720 KiB | ||||
19 | Accepted | 361ms | 23720 KiB | ||||
20 | Accepted | 349ms | 23720 KiB | ||||
21 | Accepted | 372ms | 23744 KiB | ||||
22 | Accepted | 363ms | 23484 KiB | ||||
23 | Runtime error | 16ms | 3148 KiB | ||||
24 | Runtime error | 16ms | 3132 KiB | ||||
25 | Runtime error | 17ms | 2960 KiB | ||||
26 | Runtime error | 17ms | 3132 KiB | ||||
27 | Accepted | 321ms | 23624 KiB |