2752 | 2023-01-20 22:42:23 | kristof | Zsonglőrködés | python3 | Wrong answer 0/100 | 1.588s | 68652 KiB |
N = int(input())
myDict = {}
for i in range(N):
b, j = input().split()
b = int(b)
j = int(j)
if b not in myDict:
myDict[b] = tuple(map(int, str(j)))
else:
tempList = list(map(int, myDict[b]))
tempList.append(j)
myDict[b] = tuple(tempList)
kezdo = min(myDict)
szamlalo = 1
while len(myDict) > 0:
if kezdo in myDict.keys():
temp = kezdo
kezdo = myDict[kezdo]
print(myDict)
del myDict[temp]
else:
szamlalo += 1
kezdo = min(myDict)
print(szamlalo)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 17ms | 11336 KiB | ||||
2 | Wrong answer | 17ms | 11560 KiB | ||||
subtask2 | 0/20 | ||||||
3 | Time limit exceeded | 1.504s | 4964 KiB | ||||
4 | Time limit exceeded | 1.588s | 22576 KiB | ||||
5 | Time limit exceeded | 1.554s | 48628 KiB | ||||
6 | Time limit exceeded | 1.516s | 57840 KiB | ||||
7 | Time limit exceeded | 1.524s | 67444 KiB | ||||
8 | Time limit exceeded | 1.526s | 67436 KiB | ||||
9 | Time limit exceeded | 1.544s | 67184 KiB | ||||
10 | Time limit exceeded | 1.534s | 67560 KiB | ||||
11 | Time limit exceeded | 1.514s | 67948 KiB | ||||
subtask3 | 0/35 | ||||||
12 | Wrong answer | 17ms | 13432 KiB | ||||
13 | Wrong answer | 17ms | 13664 KiB | ||||
14 | Wrong answer | 26ms | 13888 KiB | ||||
15 | Wrong answer | 19ms | 13984 KiB | ||||
16 | Wrong answer | 25ms | 14340 KiB | ||||
17 | Wrong answer | 123ms | 14348 KiB | ||||
18 | Wrong answer | 25ms | 14248 KiB | ||||
19 | Wrong answer | 123ms | 14560 KiB | ||||
20 | Wrong answer | 126ms | 14320 KiB | ||||
subtask4 | 0/45 | ||||||
21 | Time limit exceeded | 1.583s | 7672 KiB | ||||
22 | Time limit exceeded | 1.554s | 8352 KiB | ||||
23 | Time limit exceeded | 1.546s | 50576 KiB | ||||
24 | Time limit exceeded | 1.555s | 8072 KiB | ||||
25 | Time limit exceeded | 1.557s | 68652 KiB | ||||
26 | Time limit exceeded | 1.527s | 8080 KiB | ||||
27 | Time limit exceeded | 1.518s | 68612 KiB | ||||
28 | Time limit exceeded | 1.58s | 8164 KiB | ||||
29 | Time limit exceeded | 1.519s | 68576 KiB |