7302021-12-21 15:17:25kismartongBürokrácia (40)python3Wrong answer 1/40134ms25112 KiB
from sys import stdin, stdout

def main():
    n = int(stdin.readline())
    torv = [None] * n
    vInd = [None] * n
    for i in range(n):
        be = stdin.readline()
        if "R" in be:
            torv[i] = "R"
        else:
            be = be.split()
            torv[i] = "V"
            vInd[i] = int(be[1])
    akt = [None] * n
    for i in range(n):
        if torv[i] == "R":
            akt[i] = 1
        else:
            akt[i] = 1
            if akt[vInd[i]] == 1:
                akt[vInd[i]] = 0
            else:
                akt[vInd[i]] = 1
    stdout.writelines(str(akt.count(1)) + "\n")
    for i in range(n):
        if akt[i] == 1:
            stdout.write(str(i+1) + " ")

main()
SubtaskSumTestVerdictTimeMemory
base1/40
1Accepted0/017ms11188 KiB
2Wrong answer0/117ms11288 KiB
3Wrong answer0/117ms11796 KiB
4Wrong answer0/117ms12120 KiB
5Accepted1/197ms17232 KiB
6Wrong answer0/1112ms23148 KiB
7Wrong answer0/1112ms23312 KiB
8Wrong answer0/2127ms23264 KiB
9Wrong answer0/2131ms23312 KiB
10Wrong answer0/2133ms23328 KiB
11Wrong answer0/2134ms23080 KiB
12Wrong answer0/298ms18288 KiB
13Wrong answer0/2101ms18304 KiB
14Wrong answer0/2130ms22576 KiB
15Wrong answer0/2120ms21388 KiB
16Wrong answer0/2100ms19000 KiB
17Wrong answer0/2100ms18892 KiB
18Wrong answer0/2100ms19060 KiB
19Wrong answer0/296ms18468 KiB
20Wrong answer0/297ms18568 KiB
21Wrong answer0/294ms18848 KiB
22Wrong answer0/2114ms24508 KiB
23Wrong answer0/4134ms25112 KiB