38442023-03-03 11:32:03AGergoFasor (40)cpp17Runtime error 0/40196ms62976 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/03ms1920 KiB
2Wrong answer0/03ms2712 KiB
3Wrong answer0/23ms2104 KiB
4Wrong answer0/22ms2184 KiB
5Wrong answer0/23ms2440 KiB
6Wrong answer0/23ms2676 KiB
7Wrong answer0/23ms3076 KiB
8Runtime error0/23ms3292 KiB
9Wrong answer0/23ms3860 KiB
10Runtime error0/23ms4036 KiB
11Runtime error0/23ms4032 KiB
12Wrong answer0/23ms3856 KiB
13Runtime error0/26ms12428 KiB
14Wrong answer0/2196ms62976 KiB
15Wrong answer0/2125ms42204 KiB
16Wrong answer0/2109ms36456 KiB
17Runtime error0/28ms22176 KiB
18Runtime error0/214ms23140 KiB
19Runtime error0/214ms23280 KiB
20Wrong answer0/264ms25532 KiB
21Wrong answer0/2138ms44732 KiB
22Runtime error0/28ms22680 KiB