3122021-09-22 13:16:55Kevinke12Bürokrácia (40)cpp14Accepted 40/4048ms6340 KiB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int N, be;
bool nulle[100005];
int beol[100005];
char c;

int main()
{
    cin >> N;

    for(int i = 1; i <= N; i++)
    {
        cin >> c;
        if(c=='R')
        {
            beol[i]=0;
        }
        else
        {
            cin >> be;
            beol[i]=be;
        }
    }
    for(int i = N; i > 0; i--)
    {
        if(nulle[i]==0) //csinal valamit
        {
            nulle[beol[i]]=1;
        }
    }

    vector<int> ans;

    for(int i = 1; i <= N; i++)
    {
        if(nulle[i]==0) ans.push_back(i);
    }
    cout << ans.size() << "\n";
    for(int a:ans) cout << a << " ";cout << "\n";
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1828 KiB
2Accepted1/12ms2048 KiB
3Accepted1/12ms2528 KiB
4Accepted1/13ms2508 KiB
5Accepted1/123ms4536 KiB
6Accepted1/148ms4368 KiB
7Accepted1/146ms4684 KiB
8Accepted2/248ms4740 KiB
9Accepted2/248ms4744 KiB
10Accepted2/246ms4868 KiB
11Accepted2/246ms4980 KiB
12Accepted2/225ms5704 KiB
13Accepted2/225ms5904 KiB
14Accepted2/245ms5472 KiB
15Accepted2/235ms5976 KiB
16Accepted2/226ms5972 KiB
17Accepted2/226ms6088 KiB
18Accepted2/225ms6208 KiB
19Accepted2/221ms6340 KiB
20Accepted2/221ms6296 KiB
21Accepted2/221ms6252 KiB
22Accepted2/248ms5896 KiB
23Accepted4/448ms5788 KiB