Submission #76644366


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
int n;
vector<vector<int>> g;
signed main(){
    scanf("%d",&n);
    g.resize(n+1);
    for(int i=1;i<=n;++i){
        int m;
        scanf("%d",&m);
        for(int j=0;j<m;++j){
            int x;
            scanf("%d",&x);
            g[x].push_back(i);
        }
    }
    for(int i=1;i<=n;++i){
        printf("%d",(int)g[i].size());
        for(int j=0;j<g[i].size();++j) printf(" %d",g[i][j]);
        printf("\n");
    }
    return 0;
}

Submission Info

Submission Time
Task B - Gift
User Chen_Zhen_DY
Language C++23 (Clang 21.1.0)
Score 200
Code Size 512 Byte
Status AC
Exec Time 2 ms
Memory 3276 KiB

Compile Error

./Main.cpp:19:22: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
   19 |         for(int j=0;j<g[i].size();++j) printf(" %d",g[i][j]);
      |                     ~^~~~~~~~~~~~
1 warning generated.

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 2 ms 3052 KiB
00_sample_01.txt AC 1 ms 3128 KiB
00_sample_02.txt AC 1 ms 3148 KiB
01_random_00.txt AC 1 ms 3148 KiB
01_random_01.txt AC 2 ms 3276 KiB
01_random_02.txt AC 1 ms 3024 KiB
01_random_03.txt AC 1 ms 3136 KiB
01_random_04.txt AC 1 ms 3072 KiB
01_random_05.txt AC 1 ms 3256 KiB
01_random_06.txt AC 1 ms 3052 KiB
01_random_07.txt AC 1 ms 3112 KiB
01_random_08.txt AC 1 ms 3240 KiB
01_random_09.txt AC 1 ms 2900 KiB
01_random_10.txt AC 2 ms 3028 KiB