提出 #76634767
ソースコード 拡げる
#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;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Gift |
| ユーザ | Sayhere |
| 言語 | C++23 (GCC 15.2.0) |
| 得点 | 200 |
| コード長 | 559 Byte |
| 結果 | AC |
| 実行時間 | 2 ms |
| メモリ | 3668 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 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 |