2751 | 2023-01-20 22:41:52 | kristof | Zsonglőrködés | python3 | Wrong answer 0/100 | 1.605s | 68424 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 | 18ms | 11140 KiB | ||||
2 | Wrong answer | 17ms | 11512 KiB | ||||
subtask2 | 0/20 | ||||||
3 | Time limit exceeded | 1.526s | 5112 KiB | ||||
4 | Time limit exceeded | 1.57s | 22176 KiB | ||||
5 | Time limit exceeded | 1.534s | 48484 KiB | ||||
6 | Time limit exceeded | 1.519s | 57784 KiB | ||||
7 | Time limit exceeded | 1.536s | 66844 KiB | ||||
8 | Time limit exceeded | 1.544s | 67232 KiB | ||||
9 | Time limit exceeded | 1.514s | 67088 KiB | ||||
10 | Time limit exceeded | 1.527s | 67340 KiB | ||||
11 | Time limit exceeded | 1.519s | 67500 KiB | ||||
subtask3 | 0/35 | ||||||
12 | Wrong answer | 17ms | 12752 KiB | ||||
13 | Wrong answer | 17ms | 12768 KiB | ||||
14 | Wrong answer | 26ms | 13248 KiB | ||||
15 | Wrong answer | 18ms | 12920 KiB | ||||
16 | Wrong answer | 25ms | 13092 KiB | ||||
17 | Wrong answer | 125ms | 13324 KiB | ||||
18 | Wrong answer | 25ms | 13232 KiB | ||||
19 | Wrong answer | 127ms | 13380 KiB | ||||
20 | Wrong answer | 123ms | 13680 KiB | ||||
subtask4 | 0/45 | ||||||
21 | Time limit exceeded | 1.567s | 6752 KiB | ||||
22 | Time limit exceeded | 1.555s | 7788 KiB | ||||
23 | Time limit exceeded | 1.598s | 50064 KiB | ||||
24 | Time limit exceeded | 1.559s | 7444 KiB | ||||
25 | Time limit exceeded | 1.605s | 68224 KiB | ||||
26 | Time limit exceeded | 1.564s | 7744 KiB | ||||
27 | Time limit exceeded | 1.537s | 68192 KiB | ||||
28 | Time limit exceeded | 1.536s | 7888 KiB | ||||
29 | Time limit exceeded | 1.552s | 68424 KiB |