181022025-09-30 06:36:30birozsParti (75 pont)python3Wrong answer 0/75393ms16000 KiB
N = int(input())
T = {}
for i in range(N):
    A,B = map(int,input().split())
    if A not in T:
        T[A] = []
        T[A].append(i+1)
    else:
        T[A].append(i+1)
    if B not in T:
        T[B] = []
        T[B].append(i+1)
    else:
        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)
meghivott.sort()
print(len(meghivott))
for k in meghivott:
    print(k,end=" ")
SubtaskSumTestVerdictTimeMemory
base0/75
1Wrong answer0/017ms3124 KiB
2Time limit exceeded0/0393ms16000 KiB
3Wrong answer0/317ms3116 KiB
4Wrong answer0/316ms3312 KiB
5Wrong answer0/316ms3132 KiB
6Wrong answer0/317ms3128 KiB
7Wrong answer0/317ms2972 KiB
8Wrong answer0/424ms3124 KiB
9Wrong answer0/435ms3380 KiB
10Wrong answer0/489ms3672 KiB
11Wrong answer0/435ms3384 KiB
12Wrong answer0/492ms3684 KiB
13Wrong answer0/4170ms3896 KiB
14Wrong answer0/4284ms4128 KiB
15Time limit exceeded0/4379ms16000 KiB
16Runtime error0/4200ms16000 KiB
17Runtime error0/4179ms16000 KiB
18Runtime error0/4175ms16000 KiB
19Runtime error0/4167ms16000 KiB
20Runtime error0/4165ms16000 KiB
21Runtime error0/4160ms16000 KiB
22Wrong answer0/417ms3156 KiB