Submission #76622164


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
//#define int ll
//#define ll long long
#define pb emplace_back
#define pr pair<int,int>
#define mp make_pair
#define endl "\n"
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();}
	while (ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();}
	return x*f;
}
void write(int x)
{
    if(x<0)putchar('-'),x=-x;
    if(x<10)putchar(x+'0');
    else write(x/10),putchar(x%10+'0');
}
int n;
vector<int>q[105]; 
signed main(){
	n=read();
	for(int i=1;i<=n;i++){
		int u=read();
		for(int j=1;j<=u;j++){
			int k=read();
			q[k].pb(i);
		}
	}
	for(int i=1;i<=n;i++) sort(q[i].begin(),q[i].end());
	for(int i=1;i<=n;i++){
		cout<<q[i].size()<<" ";
		for(int j=0;j<q[i].size();j++) cout<<q[i][j]<<' ';
		cout<<endl;
	}
	return 0;
}


Submission Info

Submission Time
Task B - Gift
User Fireflies
Language C++23 (GCC 15.2.0)
Score 200
Code Size 860 Byte
Status AC
Exec Time 1 ms
Memory 3696 KiB

Compile Error

./Main.cpp: In function 'int main()':
./Main.cpp:36:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |                 for(int j=0;j<q[i].size();j++) cout<<q[i][j]<<' ';
      |                             ~^~~~~~~~~~~~

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 3644 KiB
00_sample_01.txt AC 1 ms 3324 KiB
00_sample_02.txt AC 1 ms 3372 KiB
01_random_00.txt AC 1 ms 3428 KiB
01_random_01.txt AC 1 ms 3516 KiB
01_random_02.txt AC 1 ms 3388 KiB
01_random_03.txt AC 1 ms 3568 KiB
01_random_04.txt AC 1 ms 3676 KiB
01_random_05.txt AC 1 ms 3676 KiB
01_random_06.txt AC 1 ms 3696 KiB
01_random_07.txt AC 1 ms 3364 KiB
01_random_08.txt AC 1 ms 3676 KiB
01_random_09.txt AC 1 ms 3488 KiB
01_random_10.txt AC 1 ms 3572 KiB