64082023-11-28 10:06:58BenedekMartonBürokrácia (40)cpp14Wrong answer 0/4048ms4808 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/03ms1872 KiB
2Wrong answer0/13ms2128 KiB
3Wrong answer0/13ms2152 KiB
4Wrong answer0/13ms2280 KiB
5Wrong answer0/121ms3296 KiB
6Wrong answer0/148ms3624 KiB
7Wrong answer0/146ms3668 KiB
8Wrong answer0/246ms3792 KiB
9Wrong answer0/246ms3876 KiB
10Wrong answer0/246ms3952 KiB
11Wrong answer0/246ms3948 KiB
12Wrong answer0/225ms3940 KiB
13Wrong answer0/225ms4052 KiB
14Wrong answer0/243ms4176 KiB
15Wrong answer0/235ms4156 KiB
16Wrong answer0/225ms4280 KiB
17Wrong answer0/225ms4492 KiB
18Wrong answer0/225ms4704 KiB
19Wrong answer0/221ms4792 KiB
20Wrong answer0/221ms4792 KiB
21Wrong answer0/221ms4788 KiB
22Wrong answer0/248ms4788 KiB
23Wrong answer0/448ms4808 KiB