181092025-09-30 16:48:57birozsParti (75 pont)python3Runtime error 6/7597ms16000 KiB
N = int(input())
T = {}
lista = []
for i in range(1,N+1):
    T[i]=[]
for i in range(N):
    A,B = map(int,input().split())
    T[A].append(i+1)
    T[B].append(i+1)
    lista.append([A,B])
meghivott = []
for kulcs,ertek in T.items():
    if lista[kulcs-1][0] in ertek and lista[kulcs-1][1] in ertek:
        meghivott.append(kulcs)
print(len(meghivott))
for k in meghivott:
    print(k,end=" ")
SubtaskSumTestVerdictTimeMemory
base6/75
1Accepted0/016ms3124 KiB
2Runtime error0/097ms16000 KiB
3Accepted3/316ms3116 KiB
4Accepted3/316ms3316 KiB
5Wrong answer0/316ms3124 KiB
6Wrong answer0/317ms3304 KiB
7Wrong answer0/317ms3124 KiB
8Wrong answer0/417ms3140 KiB
9Wrong answer0/419ms3328 KiB
10Wrong answer0/424ms3652 KiB
11Wrong answer0/419ms3384 KiB
12Wrong answer0/423ms3692 KiB
13Wrong answer0/427ms4108 KiB
14Wrong answer0/430ms4624 KiB
15Runtime error0/493ms16000 KiB
16Runtime error0/487ms16000 KiB
17Runtime error0/486ms16000 KiB
18Runtime error0/485ms16000 KiB
19Runtime error0/446ms16000 KiB
20Runtime error0/441ms16000 KiB
21Runtime error0/445ms16000 KiB
22Wrong answer0/416ms3072 KiB