27512023-01-20 22:41:52kristofZsonglőrködéspython3Wrong answer 0/1001.605s68424 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)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer18ms11140 KiB
2Wrong answer17ms11512 KiB
subtask20/20
3Time limit exceeded1.526s5112 KiB
4Time limit exceeded1.57s22176 KiB
5Time limit exceeded1.534s48484 KiB
6Time limit exceeded1.519s57784 KiB
7Time limit exceeded1.536s66844 KiB
8Time limit exceeded1.544s67232 KiB
9Time limit exceeded1.514s67088 KiB
10Time limit exceeded1.527s67340 KiB
11Time limit exceeded1.519s67500 KiB
subtask30/35
12Wrong answer17ms12752 KiB
13Wrong answer17ms12768 KiB
14Wrong answer26ms13248 KiB
15Wrong answer18ms12920 KiB
16Wrong answer25ms13092 KiB
17Wrong answer125ms13324 KiB
18Wrong answer25ms13232 KiB
19Wrong answer127ms13380 KiB
20Wrong answer123ms13680 KiB
subtask40/45
21Time limit exceeded1.567s6752 KiB
22Time limit exceeded1.555s7788 KiB
23Time limit exceeded1.598s50064 KiB
24Time limit exceeded1.559s7444 KiB
25Time limit exceeded1.605s68224 KiB
26Time limit exceeded1.564s7744 KiB
27Time limit exceeded1.537s68192 KiB
28Time limit exceeded1.536s7888 KiB
29Time limit exceeded1.552s68424 KiB