Submission

Status:

T---------------

Subtask/Task Score:

0/160

Score: 0

User: qweqwe

Problemset: Chocolate

Language: cpp

Time: 1.096 second

Submitted On: 2026-10-08 18:54:59

#include <bits/stdc++.h>
#define fastio cin.tie(0)->sync_with_stdio(0)
using namespace std;
using ll = long long;
using pii = pair<ll,ll>;
using db = long double;

int main(){
	fastio;
	int n,m;cin >> n >> m;
	unordered_set<int> used;
	for (int i=0;i<n;i++){
		int l;cin >> l;
		bool found = 0;
		for (int j=0;j<l;j++){
			int a;cin >> a;
			if (!used.count(a) && !found){
				cout << a  << "\n";
				used.insert(a);
				found = 1;
			}
		}if (!found){
			cout << 0 << "\n";
		}
	}
	return 0;
}