38422023-03-03 11:25:20AGergoFasor (40)cpp14Runtime error 0/40140ms62828 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/03ms2920 KiB
3Wrong answer0/23ms2292 KiB
4Wrong answer0/23ms2424 KiB
5Wrong answer0/23ms2688 KiB
6Wrong answer0/22ms2888 KiB
7Wrong answer0/23ms3028 KiB
8Runtime error0/23ms3444 KiB
9Wrong answer0/23ms4268 KiB
10Runtime error0/23ms4600 KiB
11Runtime error0/23ms4908 KiB
12Wrong answer0/23ms4396 KiB
13Runtime error0/26ms13344 KiB
14Runtime error0/287ms62828 KiB
15Wrong answer0/2129ms42928 KiB
16Wrong answer0/2112ms37484 KiB
17Runtime error0/29ms23100 KiB
18Runtime error0/214ms24220 KiB
19Runtime error0/214ms24120 KiB
20Wrong answer0/264ms26384 KiB
21Wrong answer0/2140ms45884 KiB
22Runtime error0/28ms23716 KiB