38432023-03-03 11:30:12AGergoFasor (40)cpp11Runtime error 0/40193ms63080 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/03ms2912 KiB
3Wrong answer0/23ms2224 KiB
4Wrong answer0/23ms2468 KiB
5Wrong answer0/23ms2588 KiB
6Wrong answer0/23ms2780 KiB
7Wrong answer0/23ms3152 KiB
8Runtime error0/23ms3236 KiB
9Wrong answer0/23ms3808 KiB
10Runtime error0/23ms4004 KiB
11Runtime error0/23ms4000 KiB
12Wrong answer0/23ms4004 KiB
13Runtime error0/26ms12956 KiB
14Wrong answer0/2193ms63080 KiB
15Wrong answer0/2129ms42688 KiB
16Wrong answer0/2112ms36976 KiB
17Runtime error0/28ms22832 KiB
18Runtime error0/214ms23676 KiB
19Runtime error0/214ms23808 KiB
20Wrong answer0/264ms26084 KiB
21Wrong answer0/2136ms45268 KiB
22Runtime error0/29ms23140 KiB