27522023-01-20 22:42:23kristofZsonglőrködéspython3Wrong answer 0/1001.588s68652 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 answer17ms11336 KiB
2Wrong answer17ms11560 KiB
subtask20/20
3Time limit exceeded1.504s4964 KiB
4Time limit exceeded1.588s22576 KiB
5Time limit exceeded1.554s48628 KiB
6Time limit exceeded1.516s57840 KiB
7Time limit exceeded1.524s67444 KiB
8Time limit exceeded1.526s67436 KiB
9Time limit exceeded1.544s67184 KiB
10Time limit exceeded1.534s67560 KiB
11Time limit exceeded1.514s67948 KiB
subtask30/35
12Wrong answer17ms13432 KiB
13Wrong answer17ms13664 KiB
14Wrong answer26ms13888 KiB
15Wrong answer19ms13984 KiB
16Wrong answer25ms14340 KiB
17Wrong answer123ms14348 KiB
18Wrong answer25ms14248 KiB
19Wrong answer123ms14560 KiB
20Wrong answer126ms14320 KiB
subtask40/45
21Time limit exceeded1.583s7672 KiB
22Time limit exceeded1.554s8352 KiB
23Time limit exceeded1.546s50576 KiB
24Time limit exceeded1.555s8072 KiB
25Time limit exceeded1.557s68652 KiB
26Time limit exceeded1.527s8080 KiB
27Time limit exceeded1.518s68612 KiB
28Time limit exceeded1.58s8164 KiB
29Time limit exceeded1.519s68576 KiB