38412023-03-03 11:22:19AGergoFasor (40)cpp17Runtime error 0/40135ms63008 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int emberszam;
    int ismertszam;

    cin >> emberszam >> ismertszam;

    vector<list<int>> rokon(emberszam+1);
    vector<list<int>> gyerek(emberszam+1);

    /*for(int i = 1; i < emberszam+1; i++)
    {

    }*/

    int x,y,z;

    for (int i = 1; i < ismertszam+1; i++)


    {
        cin >> x >> y >> z;

        auto it = rokon[x].begin();

        rokon[x].insert(it,y);
        rokon[x].insert(it,z);

        it = gyerek[x].begin();

        gyerek[y].insert(it,x);
        gyerek[z].insert(it,x);
    }

    for(int i = 1; i < emberszam+1; i++)
    {
        for(int x : rokon[i])
        {
            //if(x != i)
            //{
                cout << i << "-" << x << " szulo\n";
            //}
        }

       /*for(int x : gyerek[i])
        {
            //if(x != i)
            //{
                cout << i << "-" << x << " gyerek\n";
            //}
        }*/
    }


}
SubtaskSumTestVerdictTimeMemory
base0/40
1Runtime error0/03ms1916 KiB
2Wrong answer0/03ms2852 KiB
3Wrong answer0/23ms2236 KiB
4Wrong answer0/23ms2588 KiB
5Wrong answer0/23ms2948 KiB
6Wrong answer0/23ms2896 KiB
7Wrong answer0/23ms2956 KiB
8Runtime error0/23ms3408 KiB
9Wrong answer0/23ms4088 KiB
10Runtime error0/23ms4568 KiB
11Runtime error0/23ms4608 KiB
12Wrong answer0/23ms4484 KiB
13Runtime error0/26ms13412 KiB
14Runtime error0/283ms63008 KiB
15Wrong answer0/2128ms42700 KiB
16Wrong answer0/2112ms37248 KiB
17Runtime error0/28ms23296 KiB
18Runtime error0/214ms24052 KiB
19Runtime error0/214ms24212 KiB
20Wrong answer0/264ms26540 KiB
21Wrong answer0/2135ms45736 KiB
22Runtime error0/28ms23448 KiB