Submission #76634767


Source Code Expand

#include<iostream>
#include<cstring>
#include<vector>
#define rep(i,l,r) for(int i=l;i<=r;i++)
using namespace std;
int n,k[105],g[105][105];
signed main(){
    cin>>n;
    rep(i,1,n){
        cin>>k[i];
        rep(j,1,k[i]){
            int v;
            cin>>v;
            g[v][i]=1;
        }
    }
    rep(u,1,n){
        vector<int>cur;
        rep(v,1,n){
            if(g[u][v]&&u!=v)cur.emplace_back(v);
        }
        cout<<cur.size()<<' ';
        for(int v:cur)cout<<v<<' ';
        cout<<'\n';
    }
    return 0;
}

Submission Info

Submission Time
Task B - Gift
User Sayhere
Language C++23 (GCC 15.2.0)
Score 200
Code Size 559 Byte
Status AC
Exec Time 2 ms
Memory 3668 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 14
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3424 KiB
00_sample_01.txt AC 1 ms 3448 KiB
00_sample_02.txt AC 1 ms 3520 KiB
01_random_00.txt AC 1 ms 3520 KiB
01_random_01.txt AC 2 ms 3588 KiB
01_random_02.txt AC 1 ms 3664 KiB
01_random_03.txt AC 1 ms 3576 KiB
01_random_04.txt AC 2 ms 3644 KiB
01_random_05.txt AC 1 ms 3640 KiB
01_random_06.txt AC 1 ms 3468 KiB
01_random_07.txt AC 1 ms 3644 KiB
01_random_08.txt AC 2 ms 3648 KiB
01_random_09.txt AC 1 ms 3668 KiB
01_random_10.txt AC 2 ms 3656 KiB