181042025-09-30 10:12:30birozsParti (75 pont)python3Time limit exceeded 7/75391ms16000 KiB
N = int(input())
T = {}
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)
#print(T)
egyedi = []
for kulcs,ertek in T.items():
    if len(ertek) <= 1:
        egyedi.append(kulcs)
#print(egyedi)
meghivott = []
for kulcs,ertek in T.items():
    db = len(ertek)
    if db > 1:
        for k in egyedi:
            if k in ertek:
                db -= 1
        if db > 1:
            meghivott.append(kulcs)
print(len(meghivott))
for k in meghivott:
    print(k,end=" ")

SubtaskSumTestVerdictTimeMemory
base7/75
1Accepted0/014ms3124 KiB
2Time limit exceeded0/0391ms14896 KiB
3Wrong answer0/316ms3128 KiB
4Accepted3/316ms3120 KiB
5Wrong answer0/317ms3316 KiB
6Wrong answer0/317ms3124 KiB
7Wrong answer0/317ms3124 KiB
8Wrong answer0/425ms3124 KiB
9Wrong answer0/454ms3380 KiB
10Wrong answer0/4143ms3616 KiB
11Wrong answer0/450ms3248 KiB
12Wrong answer0/4146ms3636 KiB
13Time limit exceeded0/4308ms3880 KiB
14Time limit exceeded0/4379ms3880 KiB
15Time limit exceeded0/4391ms14900 KiB
16Runtime error0/4164ms16000 KiB
17Runtime error0/4145ms16000 KiB
18Runtime error0/4116ms16000 KiB
19Runtime error0/441ms16000 KiB
20Runtime error0/446ms16000 KiB
21Runtime error0/443ms16000 KiB
22Accepted4/416ms2912 KiB