64092023-11-28 10:09:06BenedekMartonBürokrácia (40)cpp14Wrong answer 0/4050ms4904 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int ren[n+1];
    char rv;
    for(int i=1; i<=n; i++)
    {
        cin >> rv;
        if(rv=='R')
        {
            ren[i]=0;
        }
        else
        {
            cin >> ren[i];
        }
    }
    for(int i=n; i>=1; i--)
    {
        if(ren[i]!=-1)
        {
            ren[ren[i]]=-1;
        }
        //cout << ren[i] << " ";
    }
    //cout << endl;
    for(int i=1; i<=n; i++)
    {
        if(ren[i]!=-1)
        {
            cout << i << " ";
        }
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/40
1Wrong answer0/03ms1752 KiB
2Wrong answer0/13ms1992 KiB
3Wrong answer0/13ms2200 KiB
4Wrong answer0/13ms2372 KiB
5Wrong answer0/121ms3188 KiB
6Wrong answer0/148ms3320 KiB
7Wrong answer0/146ms3508 KiB
8Wrong answer0/246ms3872 KiB
9Wrong answer0/246ms3900 KiB
10Wrong answer0/246ms3900 KiB
11Wrong answer0/246ms4032 KiB
12Wrong answer0/225ms4116 KiB
13Wrong answer0/225ms4152 KiB
14Wrong answer0/243ms4508 KiB
15Wrong answer0/235ms4524 KiB
16Wrong answer0/225ms4636 KiB
17Wrong answer0/225ms4720 KiB
18Wrong answer0/225ms4836 KiB
19Wrong answer0/221ms4800 KiB
20Wrong answer0/221ms4900 KiB
21Wrong answer0/221ms4904 KiB
22Wrong answer0/248ms4904 KiB
23Wrong answer0/450ms4900 KiB