output
stringlengths 52
181k
| instruction
stringlengths 296
182k
|
---|---|
// B - Trick or Treat
#include <bits/stdc++.h>
using namespace std;
int in(){int x;cin>>x;return x;}
int main(){
int N,K; cin>>N>>K;
set<int> ok;
int ng = N;
for(int i=0; i<K; ++i)
for(int d=in(), j=0; j<d; ++j) ok.insert(in());
cout<< ng-ok.size() <<endl;
} | ### Prompt
Your task is to create a Cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
// B - Trick or Treat
#include <bits/stdc++.h>
using namespace std;
int in(){int x;cin>>x;return x;}
int main(){
int N,K; cin>>N>>K;
set<int> ok;
int ng = N;
for(int i=0; i<K; ++i)
for(int d=in(), j=0; j<d; ++j) ok.insert(in());
cout<< ng-ok.size() <<endl;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main()
{int N, K, ans{}; cin >> N >> K;
vector<bool> bs(N);
while (K--) {int d; cin >> d; while (d--) {int A; cin >> A; bs[--A] = true;}}
for (auto b : bs) ans += !b;
cout << ans << endl;} | ### Prompt
In Cpp, your task is to solve the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main()
{int N, K, ans{}; cin >> N >> K;
vector<bool> bs(N);
while (K--) {int d; cin >> d; while (d--) {int A; cin >> A; bs[--A] = true;}}
for (auto b : bs) ans += !b;
cout << ans << endl;}
``` |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
unordered_set<int> with_snacks;
while(k--){
int d;
cin>>d;
while(d--){
int p;
cin>>p;
with_snacks.insert(p);
}
}
cout<<n - with_snacks.size();
return 0;
} | ### Prompt
Develop a solution in cpp to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
unordered_set<int> with_snacks;
while(k--){
int d;
cin>>d;
while(d--){
int p;
cin>>p;
with_snacks.insert(p);
}
}
cout<<n - with_snacks.size();
return 0;
}
``` |
#include <stdio.h>
int cnt[105],tot;
int main(){
int n,k,m,i,j,a;
scanf("%d%d",&n,&k);
for(i=1;i<=k;i++){
scanf("%d",&m);
for(j=1;j<=m;j++){
scanf("%d",&a);
cnt[a]++;
}
}
for(i=1;i<=n;i++)
if(cnt[i])tot++;
printf("%d\n",n-tot);
return 0;
} | ### Prompt
Please create a solution in cpp to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <stdio.h>
int cnt[105],tot;
int main(){
int n,k,m,i,j,a;
scanf("%d%d",&n,&k);
for(i=1;i<=k;i++){
scanf("%d",&m);
for(j=1;j<=m;j++){
scanf("%d",&a);
cnt[a]++;
}
}
for(i=1;i<=n;i++)
if(cnt[i])tot++;
printf("%d\n",n-tot);
return 0;
}
``` |
#include <iostream>
using namespace std;
int main(){
int N,K;
cin>>N>>K;
int d;
bool s[103]={0};
while(K--){
int n,x ; cin>>n;
while(n--) {
cin>>x;
s[x]=1;
}
}
int a = 0;
for(int i=1;i<=N;++i) if(!s[i]) a++;
cout<<a;
} | ### Prompt
Develop a solution in CPP to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <iostream>
using namespace std;
int main(){
int N,K;
cin>>N>>K;
int d;
bool s[103]={0};
while(K--){
int n,x ; cin>>n;
while(n--) {
cin>>x;
s[x]=1;
}
}
int a = 0;
for(int i=1;i<=N;++i) if(!s[i]) a++;
cout<<a;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main(){
long long int n,k,d,sum,temp;
cin>>n>>k;
vector<int> ans(n,0);
while(k--){
cin>>d;
for(int i=0;i<d;i++){
cin>>temp;
ans[temp-1]++;
}
}
sum=0;
for(int i=0;i<n;i++){
if(!ans[i])
sum++;
}
cout<<sum<<endl;
} | ### Prompt
In cpp, your task is to solve the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
long long int n,k,d,sum,temp;
cin>>n>>k;
vector<int> ans(n,0);
while(k--){
cin>>d;
for(int i=0;i<d;i++){
cin>>temp;
ans[temp-1]++;
}
}
sum=0;
for(int i=0;i<n;i++){
if(!ans[i])
sum++;
}
cout<<sum<<endl;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin >> n >> k;
set<int> s;
for(int i = 0;i < k;i ++){
int d;
cin >> d;
for(int j = 0;j < d;j ++){
int a;
cin >> a;
s.insert(a);
}
}
cout << n - s.size() << endl;
} | ### Prompt
Please formulate a CPP solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin >> n >> k;
set<int> s;
for(int i = 0;i < k;i ++){
int d;
cin >> d;
for(int j = 0;j < d;j ++){
int a;
cin >> a;
s.insert(a);
}
}
cout << n - s.size() << endl;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int n,m,res;
bool on[110];
int main(){
scanf("%d%d",&n,&m);
for(int i=1,x,y;i<=m;i++){
scanf("%d",&x);
while(x--)scanf("%d",&y),on[y]=true;
}
for(int i=1;i<=n;i++)res+=!on[i];
printf("%d\n",res);
return 0;
} | ### Prompt
Your task is to create a cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int n,m,res;
bool on[110];
int main(){
scanf("%d%d",&n,&m);
for(int i=1,x,y;i<=m;i++){
scanf("%d",&x);
while(x--)scanf("%d",&y),on[y]=true;
}
for(int i=1;i<=n;i++)res+=!on[i];
printf("%d\n",res);
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k,i,j,cnt=0,z,d;
cin>>n>>k;
vector<int> a(n+1,0);
for(i=0;i<k;i++)
{
cin>>d;
for(j=0;j<d;j++)
{
cin>>z;
a[z]++;
}
}
for(i=1;i<=n;i++)
{
if(a[i]==0)
cnt++;
}
cout<<cnt;
return 0;
} | ### Prompt
Please provide a cpp coded solution to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k,i,j,cnt=0,z,d;
cin>>n>>k;
vector<int> a(n+1,0);
for(i=0;i<k;i++)
{
cin>>d;
for(j=0;j<d;j++)
{
cin>>z;
a[z]++;
}
}
for(i=1;i<=n;i++)
{
if(a[i]==0)
cnt++;
}
cout<<cnt;
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,k;
cin>>n>>k;
set<int> st;
for(int i=0;i<k;i++){
int d;
cin>>d;
for(int j=0;j<d;j++){
int a;
cin>>a;
st.insert(a);
}
}
cout<<n-st.size();
} | ### Prompt
Your challenge is to write a cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,k;
cin>>n>>k;
set<int> st;
for(int i=0;i<k;i++){
int d;
cin>>d;
for(int j=0;j<d;j++){
int a;
cin>>a;
st.insert(a);
}
}
cout<<n-st.size();
}
``` |
#include<iostream>
using namespace std;
int d[100];
bool b[100]={0};
int main(){
int n,k,x,sum=0;
cin>>n>>k;
for(int i=0;i<k;i++){
cin>>d[i];
for(int j=0;j<d[i];j++){
cin>>x;
b[x-1]=1;
}
}
for(int i=0;i<n;i++){
if(b[i]==0)sum++;
}
cout<<sum<<'\n';
} | ### Prompt
Develop a solution in Cpp to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<iostream>
using namespace std;
int d[100];
bool b[100]={0};
int main(){
int n,k,x,sum=0;
cin>>n>>k;
for(int i=0;i<k;i++){
cin>>d[i];
for(int j=0;j<d[i];j++){
cin>>x;
b[x-1]=1;
}
}
for(int i=0;i<n;i++){
if(b[i]==0)sum++;
}
cout<<sum<<'\n';
}
``` |
#include<cstdio>
int main()
{
int a[105]={0},n,k,d,aa;
scanf("%d%d",&n,&k);
for(int i=0;i<k;i++)
{
scanf("%d",&d);
for(int j=1;j<=d;j++)
{
scanf("%d",&aa);
a[aa]++;
}
}
int sum=0;
for(int i=1;i<=n;i++)
if(a[i]==0) sum++;
printf("%d",sum);
} | ### Prompt
Generate a cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<cstdio>
int main()
{
int a[105]={0},n,k,d,aa;
scanf("%d%d",&n,&k);
for(int i=0;i<k;i++)
{
scanf("%d",&d);
for(int j=1;j<=d;j++)
{
scanf("%d",&aa);
a[aa]++;
}
}
int sum=0;
for(int i=1;i<=n;i++)
if(a[i]==0) sum++;
printf("%d",sum);
}
``` |
#include <iostream>
using namespace std;
int f[101];
int main(){
int n, k, d, x;
cin>>n>>k;
while(k--){
cin>>d;
while(d--){
cin>>x;
f[x]=1;
}
}
int ans=0;
for(int i=1; i<=n; i++)
if(f[i]==0)
ans++;
cout<<ans;
} | ### Prompt
Please create a solution in CPP to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <iostream>
using namespace std;
int f[101];
int main(){
int n, k, d, x;
cin>>n>>k;
while(k--){
cin>>d;
while(d--){
cin>>x;
f[x]=1;
}
}
int ans=0;
for(int i=1; i<=n; i++)
if(f[i]==0)
ans++;
cout<<ans;
}
``` |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int n,m;
cin>>n>>m;
set<int>se;
while(m--)
{
int x,y;
cin>>x;
while(x--) cin>>y,se.insert(y);
}
cout<<n-se.size();
return 0;
} | ### Prompt
Create a solution in CPP for the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int n,m;
cin>>n>>m;
set<int>se;
while(m--)
{
int x,y;
cin>>x;
while(x--) cin>>y,se.insert(y);
}
cout<<n-se.size();
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
#define int long long
int n,k,a[100005];
signed main()
{
cin>>n>>k;
for(int i=1;i<=k;i++)
{
int u,v;
cin>>u;
for(int i=1;i<=u;i++)
{
cin>>v;
a[v]=1;
}
}
int ans=0;
for(int i=1;i<=n;i++)
if(!a[i])ans++;
cout<<ans;
} | ### Prompt
Construct a cpp code solution to the problem outlined:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
#define int long long
int n,k,a[100005];
signed main()
{
cin>>n>>k;
for(int i=1;i<=k;i++)
{
int u,v;
cin>>u;
for(int i=1;i<=u;i++)
{
cin>>v;
a[v]=1;
}
}
int ans=0;
for(int i=1;i<=n;i++)
if(!a[i])ans++;
cout<<ans;
}
``` |
#include<iostream>
using namespace std;
int a[105];
int main()
{
int n,k,d,i,x;
cin>>n>>k;
for(i=0;i<k;i++)
{
cin>>d;
while(d--)
{
cin>>x;
a[x]++;
}
}
int ans=0;
for(i=1;i<=n;i++)
{
if(a[i]==0)
ans++;
}
cout<<ans;
return 0;
} | ### Prompt
Please provide a CPP coded solution to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<iostream>
using namespace std;
int a[105];
int main()
{
int n,k,d,i,x;
cin>>n>>k;
for(i=0;i<k;i++)
{
cin>>d;
while(d--)
{
cin>>x;
a[x]++;
}
}
int ans=0;
for(i=1;i<=n;i++)
{
if(a[i]==0)
ans++;
}
cout<<ans;
return 0;
}
``` |
#include<iostream>
#include<string>
using namespace std;
int main()
{
int a[105]={0},n,k;
cin>>n>>k;
for(int i=1;i<=k;i++)
{
int t,x;
cin>>t;
while(t--)
{
cin>>x;
a[x]++;
}
}
int cnt=0;
for(int i=1;i<=n;i++)
if(!a[i])cnt++;
cout<<cnt;
return 0;
} | ### Prompt
Your challenge is to write a Cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<iostream>
#include<string>
using namespace std;
int main()
{
int a[105]={0},n,k;
cin>>n>>k;
for(int i=1;i<=k;i++)
{
int t,x;
cin>>t;
while(t--)
{
cin>>x;
a[x]++;
}
}
int cnt=0;
for(int i=1;i<=n;i++)
if(!a[i])cnt++;
cout<<cnt;
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N,K;
cin>>N>>K;
vector<int>d(K);
set<int>A;
for(int i=0;i<K;i++){
cin>>d.at(i);
for(int j=0;j<d.at(i);j++){
int a=0;
cin>>a;
A.insert(a);
}
}
cout<<N-A.size()<< endl;
}
| ### Prompt
Construct a cpp code solution to the problem outlined:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int N,K;
cin>>N>>K;
vector<int>d(K);
set<int>A;
for(int i=0;i<K;i++){
cin>>d.at(i);
for(int j=0;j<d.at(i);j++){
int a=0;
cin>>a;
A.insert(a);
}
}
cout<<N-A.size()<< endl;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k; cin >> n >> k;
set<int> s;
while (k--) {
int d; cin >> d;
while (d--) {
int a; cin >> a;
s.insert(a);
}
}
cout << n-s.size();
return 0;
} | ### Prompt
Create a solution in CPP for the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k; cin >> n >> k;
set<int> s;
while (k--) {
int d; cin >> d;
while (d--) {
int a; cin >> a;
s.insert(a);
}
}
cout << n-s.size();
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
int in;
set<int> arr;
for(int i = 0;i < n;i++)
{
int d;
cin>>d;
for(int i = 0;i < d;i++)
{
cin>>in;
arr.insert(in);
}
}
cout<<n - arr.size();
return 0;
}
| ### Prompt
Please create a solution in CPP to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
int in;
set<int> arr;
for(int i = 0;i < n;i++)
{
int d;
cin>>d;
for(int i = 0;i < d;i++)
{
cin>>in;
arr.insert(in);
}
}
cout<<n - arr.size();
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
set<int>ar;
while(k--)
{
int t;
cin>>t;
while(t--)
{
int a;
cin>>a;
ar.insert(a);
}
}
cout<<n-ar.size()<<endl;
} | ### Prompt
Construct a Cpp code solution to the problem outlined:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
set<int>ar;
while(k--)
{
int t;
cin>>t;
while(t--)
{
int a;
cin>>a;
ar.insert(a);
}
}
cout<<n-ar.size()<<endl;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
int i=0;
set<int> s;
while(i<k){
int d;
cin>>d;
while(d--){
int a;
cin>>a;
s.insert(a);
}
i++;
}
cout<<n-static_cast<int>(s.size());
}
| ### Prompt
Develop a solution in CPP to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
int i=0;
set<int> s;
while(i<k){
int d;
cin>>d;
while(d--){
int a;
cin>>a;
s.insert(a);
}
i++;
}
cout<<n-static_cast<int>(s.size());
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n, k;
cin >> n >> k;
map<int, int> mp;
for(int i=0; i<k; ++i){
int d;
cin >> d;
for(int j=0; j<d; ++j){
int x;
cin >> x;
++mp[x];
}
}
cout << n - mp.size() << endl;
} | ### Prompt
In cpp, your task is to solve the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main(){
int n, k;
cin >> n >> k;
map<int, int> mp;
for(int i=0; i<k; ++i){
int d;
cin >> d;
for(int j=0; j<d; ++j){
int x;
cin >> x;
++mp[x];
}
}
cout << n - mp.size() << endl;
}
``` |
#include<stdio.h>
int main()
{
int n,k,d,a,i,j,c=0,f[101]={0};
scanf("%d %d",&n,&k);
for(i=0;i<k;i++){
scanf("%d",&d);
for(j=0;j<d;j++){
scanf("%d",&a);
f[a]=1;
}
}
for(i=1;i<=n;i++){
if(f[i]==0) c++;
}
printf("%d\n",c);
return 0;
}
| ### Prompt
Generate a CPP solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<stdio.h>
int main()
{
int n,k,d,a,i,j,c=0,f[101]={0};
scanf("%d %d",&n,&k);
for(i=0;i<k;i++){
scanf("%d",&d);
for(j=0;j<d;j++){
scanf("%d",&a);
f[a]=1;
}
}
for(i=1;i<=n;i++){
if(f[i]==0) c++;
}
printf("%d\n",c);
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
using ll=long long int;
constexpr int mod = 1e9 + 1;
int main() {
int n, k;
cin >> n >> k; set<int>s;
while (k--) {
int d; cin >> d;
while (d--) {
int x; cin >> x; s.insert(x);
}
}
cout << n - s.size();
return 0;
} | ### Prompt
Please create a solution in cpp to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
using ll=long long int;
constexpr int mod = 1e9 + 1;
int main() {
int n, k;
cin >> n >> k; set<int>s;
while (k--) {
int d; cin >> d;
while (d--) {
int x; cin >> x; s.insert(x);
}
}
cout << n - s.size();
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
int n,k;
cin>>n>>k;
set<int>s;
while(k--){
int d;
cin>>d;
while(d--){
int x;
cin>>x;
s.insert(x);
}
}
cout<<n-s.size();
} | ### Prompt
Construct a Cpp code solution to the problem outlined:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
int n,k;
cin>>n>>k;
set<int>s;
while(k--){
int d;
cin>>d;
while(d--){
int x;
cin>>x;
s.insert(x);
}
}
cout<<n-s.size();
}
``` |
#include <iostream>
#include <set>
using namespace std;
int main(){
int n, k;
cin >> n >> k;
int d, a;
set<int> s;
for(int i=0; i<k; i++){
cin >> d;
for(int j=0; j<d; j++){
cin >> a;
s.insert(a);
}
}
cout << n-s.size();
return 0;
} | ### Prompt
Your challenge is to write a cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <iostream>
#include <set>
using namespace std;
int main(){
int n, k;
cin >> n >> k;
int d, a;
set<int> s;
for(int i=0; i<k; i++){
cin >> d;
for(int j=0; j<d; j++){
cin >> a;
s.insert(a);
}
}
cout << n-s.size();
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
set<int> s;
while (k--) {
int d;
cin >> d;
while (d--) {
int a;
cin >> a;
s.insert(a);
}
}
cout << n - s.size() << endl;
}
| ### Prompt
In CPP, your task is to solve the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
set<int> s;
while (k--) {
int d;
cin >> d;
while (d--) {
int a;
cin >> a;
s.insert(a);
}
}
cout << n - s.size() << endl;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main(){
bitset<100> snukes;
int n,k; cin >> n >> k;
for(int i = 0; i<k; i++){
int d; cin >> d;
for(int j = 0; j<d; j++){
int a; cin >> a;
snukes[a-1] = 1;
}
}
cout << n - snukes.count() << endl;
} | ### Prompt
Develop a solution in CPP to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
bitset<100> snukes;
int n,k; cin >> n >> k;
for(int i = 0; i<k; i++){
int d; cin >> d;
for(int j = 0; j<d; j++){
int a; cin >> a;
snukes[a-1] = 1;
}
}
cout << n - snukes.count() << endl;
}
``` |
#include <iostream>
#include <cmath>
bool a[103]={0};
using namespace std;
int main() {
int n,k,d,all=0,l;
cin>>n>>k;
for(int i=0;i<k;i++)
{
cin>>d;
for(int j=0;j<d;j++)
{cin>>l;a[l]=1;}
}
for(int i=1;i<=n;i++)
if(!a[i])all++;
cout<<all;
return 0;
} | ### Prompt
Construct a CPP code solution to the problem outlined:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <iostream>
#include <cmath>
bool a[103]={0};
using namespace std;
int main() {
int n,k,d,all=0,l;
cin>>n>>k;
for(int i=0;i<k;i++)
{
cin>>d;
for(int j=0;j<d;j++)
{cin>>l;a[l]=1;}
}
for(int i=1;i<=n;i++)
if(!a[i])all++;
cout<<all;
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k,d;
cin>>n>>k;
int cnt=n;
set<int> set;
for(int i=0;i<k;i++){
cin>>d;
for(int j=0;j<d;j++){
int a;
cin>>a;
set.insert(a);
}
}
cout<<cnt - set.size()<<endl;
}
| ### Prompt
Your challenge is to write a CPP solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k,d;
cin>>n>>k;
int cnt=n;
set<int> set;
for(int i=0;i<k;i++){
cin>>d;
for(int j=0;j<d;j++){
int a;
cin>>a;
set.insert(a);
}
}
cout<<cnt - set.size()<<endl;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,k,x;
cin >> n >> k;
set<int> num;
for (int i = 0; i < k; i++) {
int l;
cin >> l;
for (int j = 0; j < l; j++) {
cin >> x;
num.insert(x);
}
}
cout << n - num.size() << endl;
}
| ### Prompt
Please provide a cpp coded solution to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,k,x;
cin >> n >> k;
set<int> num;
for (int i = 0; i < k; i++) {
int l;
cin >> l;
for (int j = 0; j < l; j++) {
cin >> x;
num.insert(x);
}
}
cout << n - num.size() << endl;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int m,n,i,j,x,y,g;
bool f[101];
int main()
{
cin>>m>>n;
for(i=1;i<=n;i++)
{
cin>>x;
for(j=1;j<=x;j++)
{
cin>>y;
f[y]=1;
}
}
for(i=1;i<=m;i++)if(f[i]==0)g++;
cout<<g;
return 0;
}
| ### Prompt
Create a solution in cpp for the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int m,n,i,j,x,y,g;
bool f[101];
int main()
{
cin>>m>>n;
for(i=1;i<=n;i++)
{
cin>>x;
for(j=1;j<=x;j++)
{
cin>>y;
f[y]=1;
}
}
for(i=1;i<=m;i++)if(f[i]==0)g++;
cout<<g;
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
set<int> s;
for(int i=0;i<k;i++)
{
int c1;
cin>>c1;
while(c1--)
{
int a;
cin>>a;
s.insert(a);
}
}
cout<<n-s.size()<<"\n";
return 0;
} | ### Prompt
Construct a CPP code solution to the problem outlined:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
set<int> s;
for(int i=0;i<k;i++)
{
int c1;
cin>>c1;
while(c1--)
{
int a;
cin>>a;
s.insert(a);
}
}
cout<<n-s.size()<<"\n";
return 0;
}
``` |
#include<iostream>
using namespace std;
int main(){
int n=0,k,d,x,count=0;
cin>>n>>k;
int a[100]={};
for(int i=0;i<k;i++){
cin>>d;
for(int j=0;j<d;j++){
cin>>x;
a[x-1]+=1;
}
}
for(int i=0;i<n;i++){
if(a[i]==0)
count+=1;
}
cout<<count;
} | ### Prompt
Please create a solution in CPP to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<iostream>
using namespace std;
int main(){
int n=0,k,d,x,count=0;
cin>>n>>k;
int a[100]={};
for(int i=0;i<k;i++){
cin>>d;
for(int j=0;j<d;j++){
cin>>x;
a[x-1]+=1;
}
}
for(int i=0;i<n;i++){
if(a[i]==0)
count+=1;
}
cout<<count;
}
``` |
#include <iostream>
#include <set>
using namespace std;
int main() {
int n, k, d, tmp;
set<int> a;
cin >> n >> k;
while(cin >> d) {
for (int i=0; i < d; i++) {
cin >> tmp;
a.insert(tmp);
}
}
cout << n - a.size() << endl;
} | ### Prompt
Please formulate a cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <iostream>
#include <set>
using namespace std;
int main() {
int n, k, d, tmp;
set<int> a;
cin >> n >> k;
while(cin >> d) {
for (int i=0; i < d; i++) {
cin >> tmp;
a.insert(tmp);
}
}
cout << n - a.size() << endl;
}
``` |
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int n,k,a[105],aa;
int main(){
cin>>n>>k;
while(k--){
int s,x;
cin>>s;
while(s--)cin>>x,a[x]=1;
}
for(int i=1;i<=n;i++)if(!a[i])aa++;
cout<<aa;
}
| ### Prompt
In CPP, your task is to solve the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int n,k,a[105],aa;
int main(){
cin>>n>>k;
while(k--){
int s,x;
cin>>s;
while(s--)cin>>x,a[x]=1;
}
for(int i=1;i<=n;i++)if(!a[i])aa++;
cout<<aa;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int i,j,n,k,a,b,c;
int main(){
cin>>n>>k;
vector<int> x(n);
for(;i<k;i++){
cin>>a;
for(j=0;j<a;j++){
cin>>b;b--;
x[b]++;
}
}
for(i=0;i<n;i++)if(x[i]==0)c++;
cout<<c;
} | ### Prompt
Develop a solution in Cpp to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int i,j,n,k,a,b,c;
int main(){
cin>>n>>k;
vector<int> x(n);
for(;i<k;i++){
cin>>a;
for(j=0;j<a;j++){
cin>>b;b--;
x[b]++;
}
}
for(i=0;i<n;i++)if(x[i]==0)c++;
cout<<c;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
set<int>a;
for(int i=0;i<k;i++){
int d;
cin>>d;
vector<int>aaa(d);
for(int j=0;j<d;j++){
int temp;
cin>>temp;
a.insert(temp);
}
}
cout<<n-a.size()<<endl;
} | ### Prompt
Please formulate a CPP solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
set<int>a;
for(int i=0;i<k;i++){
int d;
cin>>d;
vector<int>aaa(d);
for(int j=0;j<d;j++){
int temp;
cin>>temp;
a.insert(temp);
}
}
cout<<n-a.size()<<endl;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
map<int,int>freq;
for(int i=0; i<k; ++i)
{
int a;
cin>>a;
int arr[a];
for(int j=0; j<a; ++j)
{
cin>>arr[j];
++freq[arr[j]];
}
}
int cnt(0);
for(int i=0; i<n; ++i)
cnt+=(freq[i+1]==0?1:0);
cout<<cnt;
}
| ### Prompt
Your task is to create a CPP solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
map<int,int>freq;
for(int i=0; i<k; ++i)
{
int a;
cin>>a;
int arr[a];
for(int j=0; j<a; ++j)
{
cin>>arr[j];
++freq[arr[j]];
}
}
int cnt(0);
for(int i=0; i<n; ++i)
cnt+=(freq[i+1]==0?1:0);
cout<<cnt;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int n,k,d,a,arr[101],sum;
int main(){
cin>>n>>k;
for(int i = 1;i <= k;i ++){
cin>>d;
for(int j = 1;j <= d;j++){
cin>>a;
arr[a]++;
}
}
for(int i = 1;i <= n;i++){
if(arr[i] == 0){
sum++;
}
}
cout<<sum<<endl;
}
| ### Prompt
Construct a Cpp code solution to the problem outlined:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int n,k,d,a,arr[101],sum;
int main(){
cin>>n>>k;
for(int i = 1;i <= k;i ++){
cin>>d;
for(int j = 1;j <= d;j++){
cin>>a;
arr[a]++;
}
}
for(int i = 1;i <= n;i++){
if(arr[i] == 0){
sum++;
}
}
cout<<sum<<endl;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int n,k,d,a;
set<int>S;
int main() {
cin >> n >> k;
for(int i = 0;i<k;i++){
cin >> d;
for(int j = 0;j<d;j++){
cin >> a;S.insert(a);
}
}cout << n - S.size() << endl;
return 0;
}
| ### Prompt
Create a solution in cpp for the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int n,k,d,a;
set<int>S;
int main() {
cin >> n >> k;
for(int i = 0;i<k;i++){
cin >> d;
for(int j = 0;j<d;j++){
cin >> a;S.insert(a);
}
}cout << n - S.size() << endl;
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int l[101];
int a,n,i,j,k,s;
long long mx;
int main(){
ios::sync_with_stdio(0);
cin>>n>>k;
for(i=1;i<=k;i++)
{
cin>>s;
for(j=1;j<=s;j++)
{
cin>>a;
l[a]=1;
}
}
for(i=1;i<=n;i++)
{
if(l[i]==0)
mx++;
}
cout<<mx;
}
| ### Prompt
Please formulate a CPP solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int l[101];
int a,n,i,j,k,s;
long long mx;
int main(){
ios::sync_with_stdio(0);
cin>>n>>k;
for(i=1;i<=k;i++)
{
cin>>s;
for(j=1;j<=s;j++)
{
cin>>a;
l[a]=1;
}
}
for(i=1;i<=n;i++)
{
if(l[i]==0)
mx++;
}
cout<<mx;
}
``` |
#include<iostream>
using namespace std;
int main() {
int n, m, x, y;
int a[105] = {0};
cin>>n>>m;
for (int i = 0; i < m; i++) {
cin>>x;
for (int j = 0; j < x; j++) {
cin>>y;
a[y] = 1;
}
}
int cnt = 0;
for (int i = 1; i <= n; i++)
if (!a[i]) cnt++;
cout<<cnt;
} | ### Prompt
Construct a Cpp code solution to the problem outlined:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<iostream>
using namespace std;
int main() {
int n, m, x, y;
int a[105] = {0};
cin>>n>>m;
for (int i = 0; i < m; i++) {
cin>>x;
for (int j = 0; j < x; j++) {
cin>>y;
a[y] = 1;
}
}
int cnt = 0;
for (int i = 1; i <= n; i++)
if (!a[i]) cnt++;
cout<<cnt;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int n,k,d,ans;
vector<bool>a;
int main(){
cin>>n>>k;
a.resize(n);
int x;
for(int i=0;i<k;i++){
cin>>d;
for(int j=0;j<d;j++){
cin>>x;
a[--x]=1;
}
}
for(int i=0;i<n;i++)ans+=1-a[i];
cout<<ans;
return 0;
}
| ### Prompt
Construct a Cpp code solution to the problem outlined:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int n,k,d,ans;
vector<bool>a;
int main(){
cin>>n>>k;
a.resize(n);
int x;
for(int i=0;i<k;i++){
cin>>d;
for(int j=0;j<d;j++){
cin>>x;
a[--x]=1;
}
}
for(int i=0;i<n;i++)ans+=1-a[i];
cout<<ans;
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n,k,j,p;
cin >> n >> k;
set<int> s;
for(int i=0;i<k;i++)
{
cin >> j;
for(int l=0;l<j;l++)
{
cin >> p;
s.insert(p);
}
}
cout << n- s.size();
return 0;
} | ### Prompt
Generate a CPP solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n,k,j,p;
cin >> n >> k;
set<int> s;
for(int i=0;i<k;i++)
{
cin >> j;
for(int l=0;l<j;l++)
{
cin >> p;
s.insert(p);
}
}
cout << n- s.size();
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k,d,a,cnt,vis[106]={},ans=0;
scanf("%d%d",&n,&k);
while(k--) {
scanf("%d",&d);
while(d--) {
scanf("%d",&a);
if(!vis[a]) vis[a]=1;
}
}
for(int i=1;i<=n;++i) if(!vis[i]) ans++;
cout<<ans;
} | ### Prompt
Your task is to create a cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k,d,a,cnt,vis[106]={},ans=0;
scanf("%d%d",&n,&k);
while(k--) {
scanf("%d",&d);
while(d--) {
scanf("%d",&a);
if(!vis[a]) vis[a]=1;
}
}
for(int i=1;i<=n;++i) if(!vis[i]) ans++;
cout<<ans;
}
``` |
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
int n,k,di,a,b,c;
cin>>n>>k;
set<int>s;
for(int i=0;i<k;i++)
{
cin>>a;
for(int j=0;j<a;j++)
{
cin>>b;
s.insert(b);
}
}
cout<<n-s.size();
} | ### Prompt
Please formulate a Cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
int n,k,di,a,b,c;
cin>>n>>k;
set<int>s;
for(int i=0;i<k;i++)
{
cin>>a;
for(int j=0;j<a;j++)
{
cin>>b;
s.insert(b);
}
}
cout<<n-s.size();
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main()
{int N, K, d, A; cin >> N >> K;
map<int, int> m; while (cin >> d) while (d--) cin >> A, m[A];
cout << N - m.size();} | ### Prompt
Please create a solution in CPP to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main()
{int N, K, d, A; cin >> N >> K;
map<int, int> m; while (cin >> d) while (d--) cin >> A, m[A];
cout << N - m.size();}
``` |
#include <bits/stdc++.h>
using namespace std;
int main(){
int N,K;
cin >> N >> K;
int d;
set<int> S;
for(int i=0;i<K;i++){
cin >> d;
vector<int> vec(d);
for(int j=0;j<d;j++){
cin >> vec.at(j);
}
for(int x : vec){
S.insert(x);
}
}
cout << N - S.size() << endl;
} | ### Prompt
Your challenge is to write a Cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main(){
int N,K;
cin >> N >> K;
int d;
set<int> S;
for(int i=0;i<K;i++){
cin >> d;
vector<int> vec(d);
for(int j=0;j<d;j++){
cin >> vec.at(j);
}
for(int x : vec){
S.insert(x);
}
}
cout << N - S.size() << endl;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int n,k,d,ans;
int flag[105];
int main()
{
cin>>n>>k;
while(k--){
cin>>d;
int tmp;
while(d--){
cin>>tmp;
flag[tmp]++;
}
}
for(int i=1;i<=n;i++){
if(flag[i])ans++;
}
//cout<<endl;
cout<<n-ans;
return 0;
} | ### Prompt
Please provide a cpp coded solution to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int n,k,d,ans;
int flag[105];
int main()
{
cin>>n>>k;
while(k--){
cin>>d;
int tmp;
while(d--){
cin>>tmp;
flag[tmp]++;
}
}
for(int i=1;i<=n;i++){
if(flag[i])ans++;
}
//cout<<endl;
cout<<n-ans;
return 0;
}
``` |
#include <cstdio>
using namespace std;
int a[105];
int main(){
int n,k,m,t,c=0;
scanf("%d%d",&n,&k);
for(int i=1;i<=k;++i){
scanf("%d",&m);
for(int j=1;j<=m;++j){
scanf("%d",&t);
++a[t];
}
}
for(int i=1;i<=n;++i){
if(a[i]==0)++c;
}
printf("%d\n",c);
return 0;
}
| ### Prompt
Please provide a cpp coded solution to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <cstdio>
using namespace std;
int a[105];
int main(){
int n,k,m,t,c=0;
scanf("%d%d",&n,&k);
for(int i=1;i<=k;++i){
scanf("%d",&m);
for(int j=1;j<=m;++j){
scanf("%d",&t);
++a[t];
}
}
for(int i=1;i<=n;++i){
if(a[i]==0)++c;
}
printf("%d\n",c);
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,k;
cin>>n>>k;
set<int> S;
for(int i =0; i<k ; i++){
int d=0;
cin>>d;
for(int j =0; j<d ; j++){
int a=0;
cin>>a;
S.insert(a);}
}
cout<< n-S.size() << endl;
}
| ### Prompt
Your task is to create a cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,k;
cin>>n>>k;
set<int> S;
for(int i =0; i<k ; i++){
int d=0;
cin>>d;
for(int j =0; j<d ; j++){
int a=0;
cin>>a;
S.insert(a);}
}
cout<< n-S.size() << endl;
}
``` |
#include <iostream>
#include <set>
using namespace std;
int main(){
int n,k;
set<int> a;
cin >> n >> k;
for(int i= 0;i < k;i++){
int d;
cin >> d;
for(int j = 0;j < d;j++){
int buf;
cin >> buf;
a.insert(buf);
}
}
cout << (n - a.size());
return 0;
}
| ### Prompt
Develop a solution in cpp to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <iostream>
#include <set>
using namespace std;
int main(){
int n,k;
set<int> a;
cin >> n >> k;
for(int i= 0;i < k;i++){
int d;
cin >> d;
for(int j = 0;j < d;j++){
int buf;
cin >> buf;
a.insert(buf);
}
}
cout << (n - a.size());
return 0;
}
``` |
#include<iostream>
using namespace std;
int main(){
int N,K,d,A,ans=0;
bool a[100]={0};
cin>>N>>K;
for(int i=0;i<K;i++){
cin>>d;
for(int j=0;j<d;j++){
cin>>A;
a[A-1]=true;
}
}
for(int i=0;i<N;i++){
if(!a[i])ans++;
}
cout<<ans;
return 0;
} | ### Prompt
Create a solution in cpp for the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<iostream>
using namespace std;
int main(){
int N,K,d,A,ans=0;
bool a[100]={0};
cin>>N>>K;
for(int i=0;i<K;i++){
cin>>d;
for(int j=0;j<d;j++){
cin>>A;
a[A-1]=true;
}
}
for(int i=0;i<N;i++){
if(!a[i])ans++;
}
cout<<ans;
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;int main(){int n,k;cin>>n>>k;unordered_set<int> g;for(int i=0;i<k;i++){int d;cin>>d;for(int i=0;i<d;i++){int u;cin>>u;g.insert(u);}}int r=g.size();cout<<n-r<<endl;} | ### Prompt
In cpp, your task is to solve the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;int main(){int n,k;cin>>n>>k;unordered_set<int> g;for(int i=0;i<k;i++){int d;cin>>d;for(int i=0;i<d;i++){int u;cin>>u;g.insert(u);}}int r=g.size();cout<<n-r<<endl;}
``` |
#include <bits/stdc++.h>
using namespace std;
int main(){
int N,K;
cin >> N >> K;
set<int> s;
for(int i=0;i<K;i++){
int d;
cin >> d;
for(int j=0;j<d;j++){
int A;
cin >> A;
s.insert(A);
}
}
cout << N-s.size() << endl;
return 0;
}
| ### Prompt
Create a solution in cpp for the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main(){
int N,K;
cin >> N >> K;
set<int> s;
for(int i=0;i<K;i++){
int d;
cin >> d;
for(int j=0;j<d;j++){
int A;
cin >> A;
s.insert(A);
}
}
cout << N-s.size() << endl;
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int n,sum[101],ans,m;
int main()
{
cin>>n>>m;
for(int i=1;i<=m;i++)
{
int x;
cin>>x;
for(int j=1;j<=x;j++)
{
int y;
cin>>y;
sum[y]++;
}
}
for(int i=1;i<=n;i++)ans+=(sum[i]==0?1:0);
cout<<ans;
}
| ### Prompt
Develop a solution in cpp to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int n,sum[101],ans,m;
int main()
{
cin>>n>>m;
for(int i=1;i<=m;i++)
{
int x;
cin>>x;
for(int j=1;j<=x;j++)
{
int y;
cin>>y;
sum[y]++;
}
}
for(int i=1;i<=n;i++)ans+=(sum[i]==0?1:0);
cout<<ans;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int n,k,d,a,ans;
bool s[111];
int main()
{
cin>>n>>k;
for(int i=0;i<k;i++){
cin>>d;
for(int j=0;j<d;j++){
cin>>a;
s[a]=1;
}
}
for(int i=1;i<=n;i++){
if(!s[i])ans++;
}
cout<<ans;
return 0;
} | ### Prompt
Please provide a Cpp coded solution to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int n,k,d,a,ans;
bool s[111];
int main()
{
cin>>n>>k;
for(int i=0;i<k;i++){
cin>>d;
for(int j=0;j<d;j++){
cin>>a;
s[a]=1;
}
}
for(int i=1;i<=n;i++){
if(!s[i])ans++;
}
cout<<ans;
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
bool ok[101];
int n,k,q,a,ans;
int main(){
cin>>n>>k;
for (int i=0;i<k;i++){
cin>>q;
for (int j=0;j<q;j++){
cin>>a;
ok[a]=true;
}
}
for (int i=1;i<=n;i++) if (ok[i]==false) ans++;
cout<<ans<<"\n";
} | ### Prompt
Please create a solution in CPP to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
bool ok[101];
int n,k,q,a,ans;
int main(){
cin>>n>>k;
for (int i=0;i<k;i++){
cin>>q;
for (int j=0;j<q;j++){
cin>>a;
ok[a]=true;
}
}
for (int i=1;i<=n;i++) if (ok[i]==false) ans++;
cout<<ans<<"\n";
}
``` |
#include<bits/stdc++.h>
using namespace std;
bool vis[105];
int main(){
int n,k,d,x,ans=0;scanf("%d%d",&n,&k);
for(int i=0;i<k;i++){
scanf("%d",&d);
for(int j=0;j<d;j++)scanf("%d",&x),vis[x]=1;
}
for(int i=1;i<=n;i++)if(!vis[i])ans++;
printf("%d",ans);
return 0;
} | ### Prompt
Construct a CPP code solution to the problem outlined:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
bool vis[105];
int main(){
int n,k,d,x,ans=0;scanf("%d%d",&n,&k);
for(int i=0;i<k;i++){
scanf("%d",&d);
for(int j=0;j<d;j++)scanf("%d",&x),vis[x]=1;
}
for(int i=1;i<=n;i++)if(!vis[i])ans++;
printf("%d",ans);
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[105],n,k,ans,y;
int main()
{
cin>>n>>k;
int x;
for(int i=1;i<=k;i++)
{
cin>>x;
for(int j=1;j<=x;j++)
{
cin>>y;
a[y]++;
}
}
for(int i=1;i<=n;i++)
{
if(a[i]==0)ans++;
}
cout<<ans;
return 0;
} | ### Prompt
Please formulate a cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[105],n,k,ans,y;
int main()
{
cin>>n>>k;
int x;
for(int i=1;i<=k;i++)
{
cin>>x;
for(int j=1;j<=x;j++)
{
cin>>y;
a[y]++;
}
}
for(int i=1;i<=n;i++)
{
if(a[i]==0)ans++;
}
cout<<ans;
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main(){
set <int> snuke;
int n, k;
cin >> n >> k;
for(int i = 0; i < k; i++){
int a;
cin >> a;
for(int j = 0; j < a; j++){
int s;
cin >> s;
snuke.insert(s);
}
}
cout << n - snuke.size();
} | ### Prompt
Please formulate a CPP solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main(){
set <int> snuke;
int n, k;
cin >> n >> k;
for(int i = 0; i < k; i++){
int a;
cin >> a;
for(int j = 0; j < a; j++){
int s;
cin >> s;
snuke.insert(s);
}
}
cout << n - snuke.size();
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k,i,j,p,q;
cin>>n>>k;
set<int>x;
for(i=0;i<k;i++)
{
cin>>p;
for(j=0;j<p;j++)
{
cin>>q;
x.insert(q);
}
}
cout<<n-x.size()<<endl;
return 0;
}
| ### Prompt
In Cpp, your task is to solve the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k,i,j,p,q;
cin>>n>>k;
set<int>x;
for(i=0;i<k;i++)
{
cin>>p;
for(j=0;j<p;j++)
{
cin>>q;
x.insert(q);
}
}
cout<<n-x.size()<<endl;
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k, d, a;
cin >> n >> k;
set<int> s;
for(int i = 0; i < k; i++){
cin >> d;
for(int i = 0; i < d; i++){
cin >> a;
s.insert(a);
}
}
cout << n-s.size() << endl;
} | ### Prompt
Create a solution in CPP for the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k, d, a;
cin >> n >> k;
set<int> s;
for(int i = 0; i < k; i++){
cin >> d;
for(int i = 0; i < d; i++){
cin >> a;
s.insert(a);
}
}
cout << n-s.size() << endl;
}
``` |
#include<iostream>
using namespace std;
int n,k,a,b,p[107],s,i,j;
int main(){
for(cin>>n>>k,i=0;i++<k;)
for(cin>>a,j=0;j++<a;) cin>>b, p[b]=1;
for(i=s=0;i<n;) s+=(!p[++i]);
cout<<s;
} | ### Prompt
Please formulate a cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<iostream>
using namespace std;
int n,k,a,b,p[107],s,i,j;
int main(){
for(cin>>n>>k,i=0;i++<k;)
for(cin>>a,j=0;j++<a;) cin>>b, p[b]=1;
for(i=s=0;i<n;) s+=(!p[++i]);
cout<<s;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int v[101];
int main()
{
int n,k,i,d,c,j,a=0;
cin>>n>>k;
for(i=1;i<=k;i++)
{
cin>>d;
for(j=1;j<=d;j++)
{
cin>>c;
v[c]=1;
}
}
for(i=1;i<=n;i++)if(v[i]==0)a++;
cout<<a;
return 0;
}
| ### Prompt
In cpp, your task is to solve the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int v[101];
int main()
{
int n,k,i,d,c,j,a=0;
cin>>n>>k;
for(i=1;i<=k;i++)
{
cin>>d;
for(j=1;j<=d;j++)
{
cin>>c;
v[c]=1;
}
}
for(i=1;i<=n;i++)if(v[i]==0)a++;
cout<<a;
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main(){int N,K,d,x;cin>>N>>K;vector<int>a(N,1);x=N;
for(int i=0;i<K;i++){cin>>d;for(int j=0;j<d;j++){int b;cin>>b;if(a.at(b-1)){a.at(b-1)=0;x--;}}}
cout<<x<<endl;}
| ### Prompt
Create a solution in CPP for the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){int N,K,d,x;cin>>N>>K;vector<int>a(N,1);x=N;
for(int i=0;i<K;i++){cin>>d;for(int j=0;j<d;j++){int b;cin>>b;if(a.at(b-1)){a.at(b-1)=0;x--;}}}
cout<<x<<endl;}
``` |
#include<bits/stdc++.h>
using namespace std;
int main()
{int n,k,num,num1,count=0;cin>>n>>k;
map<int ,int>f;
for(int i=0;i<k;i++)
{
cin>>num;
for(int i=0;i<num;i++)
{cin>>num1;f[num1]++;}
}
for(int i=1;i<=n;i++)
{if(f[i]==0)count++;
}
cout<<count;
return 0;
} | ### Prompt
Develop a solution in Cpp to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{int n,k,num,num1,count=0;cin>>n>>k;
map<int ,int>f;
for(int i=0;i<k;i++)
{
cin>>num;
for(int i=0;i<num;i++)
{cin>>num1;f[num1]++;}
}
for(int i=1;i<=n;i++)
{if(f[i]==0)count++;
}
cout<<count;
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main(){
int N,K;
cin>>N>>K;
set<int>S;
for(int i=0;i<K;i++){
int d;
cin>>d;
for(int j=0;j<d;j++){
int a;
cin>>a;
S.insert(a);
}
}int b=S.size();
cout<<N-b<<endl;
return 0;
} | ### Prompt
Please provide a cpp coded solution to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
int N,K;
cin>>N>>K;
set<int>S;
for(int i=0;i<K;i++){
int d;
cin>>d;
for(int j=0;j<d;j++){
int a;
cin>>a;
S.insert(a);
}
}int b=S.size();
cout<<N-b<<endl;
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
unordered_map<int,int> m;
for(int i=0;i<k;i++)
{
int d;
cin>>d;
for(int i=0;i<d;i++)
{
int v;
cin>>v;
m[v]=1;
}
}
int ans=n-m.size();
cout<<ans;
} | ### Prompt
Your challenge is to write a Cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
unordered_map<int,int> m;
for(int i=0;i<k;i++)
{
int d;
cin>>d;
for(int i=0;i<d;i++)
{
int v;
cin>>v;
m[v]=1;
}
}
int ans=n-m.size();
cout<<ans;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main(){
int N,K;
cin>>N>>K;
set<int> A;
for(int i=0;i<K;i++){
int d;
cin>>d;
for(int j=0;j<d;j++){
int a;
cin>>a;
A.insert(a);
}
}
cout<<N-A.size()<<endl;
} | ### Prompt
Your task is to create a cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main(){
int N,K;
cin>>N>>K;
set<int> A;
for(int i=0;i<K;i++){
int d;
cin>>d;
for(int j=0;j<d;j++){
int a;
cin>>a;
A.insert(a);
}
}
cout<<N-A.size()<<endl;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k; cin >> n >> k;
set<int>s;
for(int i = 0; i < n; i++){
int d; cin>> d;
for(int j = 0; j < d; j++){
int a; cin >> a;
s.insert(a);
}
}
cout << n - s.size();
} | ### Prompt
Generate a Cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k; cin >> n >> k;
set<int>s;
for(int i = 0; i < n; i++){
int d; cin>> d;
for(int j = 0; j < d; j++){
int a; cin >> a;
s.insert(a);
}
}
cout << n - s.size();
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k,d,a,ba=0;
set<int> mon;
cin>>n>>k;
for(int t=0;t<k;t++)
{
cin>>d;
for(int i=0;i<d;i++)
{
cin>>a;
mon.insert (a);
}
}
cout<<n-mon.size();
return 0;
} | ### Prompt
Please formulate a Cpp solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k,d,a,ba=0;
set<int> mon;
cin>>n>>k;
for(int t=0;t<k;t++)
{
cin>>d;
for(int i=0;i<d;i++)
{
cin>>a;
mon.insert (a);
}
}
cout<<n-mon.size();
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main() {
int n,k,d,x;
cin>>n>>k;
set<int> s;
for(int i=1;i<=k;i++) {
cin>>d;
while(d--) {
cin>>x;
s.insert(x);
}
}
//int co
cout<<n-s.size()<<endl;
return 0;
}
| ### Prompt
Create a solution in Cpp for the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main() {
int n,k,d,x;
cin>>n>>k;
set<int> s;
for(int i=1;i<=k;i++) {
cin>>d;
while(d--) {
cin>>x;
s.insert(x);
}
}
//int co
cout<<n-s.size()<<endl;
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int n,k,d,x,m[105],c;
int main()
{
cin>>n>>k;
for(int i=1;i<=k;i++){
cin>>d;
for(int j=1;j<=d;j++)cin>>x,m[x]++;
}
for(int i=1;i<=n;i++)if(!m[i])c++;
cout<<c<<endl;
return 0;
} | ### Prompt
Construct a cpp code solution to the problem outlined:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int n,k,d,x,m[105],c;
int main()
{
cin>>n>>k;
for(int i=1;i<=k;i++){
cin>>d;
for(int j=1;j<=d;j++)cin>>x,m[x]++;
}
for(int i=1;i<=n;i++)if(!m[i])c++;
cout<<c<<endl;
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,k; cin >> n >> k;
vector<int> data(n);
for(int i=0;i<k;i++){
int d; cin >> d;
for(int j=0;j<d;j++){
int a; cin >> a; a--;
data.at(a)++;
}
}
cout << count(data.begin(),data.end(),0);
} | ### Prompt
Construct a CPP code solution to the problem outlined:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,k; cin >> n >> k;
vector<int> data(n);
for(int i=0;i<k;i++){
int d; cin >> d;
for(int j=0;j<d;j++){
int a; cin >> a; a--;
data.at(a)++;
}
}
cout << count(data.begin(),data.end(),0);
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
map <int,int> m;
while(k--)
{
int d;
cin>>d;
int arr[d];
for(int i=0;i<d;i++)
{
cin>>arr[i];
m[arr[i]]++;
}
}
cout<<n-m.size()<<endl;
}
| ### Prompt
Please provide a Cpp coded solution to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
map <int,int> m;
while(k--)
{
int d;
cin>>d;
int arr[d];
for(int i=0;i<d;i++)
{
cin>>arr[i];
m[arr[i]]++;
}
}
cout<<n-m.size()<<endl;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t,d;cin>>d>>t;
set<int>s;
while(t--)
{
int n;cin>>n;
for(int i=0;i<n;i++)
{ int m;
cin>>m;
s.insert(m);
}
}
cout<<d-s.size()<<endl;
}
| ### Prompt
Construct a CPP code solution to the problem outlined:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t,d;cin>>d>>t;
set<int>s;
while(t--)
{
int n;cin>>n;
for(int i=0;i<n;i++)
{ int m;
cin>>m;
s.insert(m);
}
}
cout<<d-s.size()<<endl;
}
``` |
#include<bits/stdc++.h>
using namespace std;typedef long long ll;int main(){ll n,k;cin>>n>>k;unordered_set<ll> done;for(int i=0;i<k;i++){ll d;cin>>d;for(int i=0;i<d;i++){ll u;cin>>u;done.insert(u);}}ll ds=done.size();cout<<n-ds<<endl;} | ### Prompt
Your task is to create a CPP solution to the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;typedef long long ll;int main(){ll n,k;cin>>n>>k;unordered_set<ll> done;for(int i=0;i<k;i++){ll d;cin>>d;for(int i=0;i<d;i++){ll u;cin>>u;done.insert(u);}}ll ds=done.size();cout<<n-ds<<endl;}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, K, d, A;
cin >> N >> K;
set<int> SE;
while (K-- && cin >> d) while (d-- && cin >> A) SE.insert(A);
cout << N - SE.size() << "\n";
} | ### Prompt
Please provide a cpp coded solution to the problem described below:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, K, d, A;
cin >> N >> K;
set<int> SE;
while (K-- && cin >> d) while (d-- && cin >> A) SE.insert(A);
cout << N - SE.size() << "\n";
}
``` |
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
ll n,k;
set<ll>s;
cin>>n>>k;
ll i;
for(i=0;i<k;i++)
{
ll c,d;
cin>>c;
for(ll j=0;j<c;j++)
cin>>d,s.insert(d);
}
cout<<n-s.size()<<endl;
return 0;
}
| ### Prompt
In CPP, your task is to solve the following problem:
N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.
There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.
Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?
Constraints
* All values in input are integers.
* 1 \leq N \leq 100
* 1 \leq K \leq 100
* 1 \leq d_i \leq N
* 1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N
Input
Input is given from Standard Input in the following format:
N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}
Output
Print the answer.
Examples
Input
3 2
2
1 3
1
3
Output
1
Input
3 3
1
3
1
3
1
3
Output
2
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
ll n,k;
set<ll>s;
cin>>n>>k;
ll i;
for(i=0;i<k;i++)
{
ll c,d;
cin>>c;
for(ll j=0;j<c;j++)
cin>>d,s.insert(d);
}
cout<<n-s.size()<<endl;
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main(){
string s,t;cin>>s>>t;
t=t+s;
cout<<t<<endl;
} | ### Prompt
Create a solution in CPP for the following problem:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
string s,t;cin>>s>>t;
t=t+s;
cout<<t<<endl;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s,r;
cin>>s>>r;
cout<<r+s<<"\n";
} | ### Prompt
In CPP, your task is to solve the following problem:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s,r;
cin>>s>>r;
cout<<r+s<<"\n";
}
``` |
#include <bits/stdc++.h>
int main(){std::string s,t;std::cin>>s>>t;std::cout<<t+s;} | ### Prompt
In cpp, your task is to solve the following problem:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include <bits/stdc++.h>
int main(){std::string s,t;std::cin>>s>>t;std::cout<<t+s;}
``` |
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s,t;
cin>>s>>t;
t+=s;
cout<<t;
} | ### Prompt
Please provide a CPP coded solution to the problem described below:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s,t;
cin>>s>>t;
t+=s;
cout<<t;
}
``` |
#include<iostream>
using namespace std;
int main(void)
{
string s,t; cin>>s>>t;
cout<<t+s<<endl;
return 0;
} | ### Prompt
Please formulate a Cpp solution to the following problem:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include<iostream>
using namespace std;
int main(void)
{
string s,t; cin>>s>>t;
cout<<t+s<<endl;
return 0;
}
``` |
#include<iostream>
using namespace std;
int main(){
string a,b;
cin>>a>>b;
cout<<b+a;
} | ### Prompt
Construct a CPP code solution to the problem outlined:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include<iostream>
using namespace std;
int main(){
string a,b;
cin>>a>>b;
cout<<b+a;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main()
{
string a,b;
cin>>a>>b;
string c = b+a;
cout<<c;
} | ### Prompt
Please formulate a Cpp solution to the following problem:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
string a,b;
cin>>a>>b;
string c = b+a;
cout<<c;
}
``` |
#include<iostream>
using namespace std;
int main()
{
string a,b,c;
cin>>a>>b;
c=a;
a=b;
b=c;
cout<<a<<b;
} | ### Prompt
Please create a solution in CPP to the following problem:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include<iostream>
using namespace std;
int main()
{
string a,b,c;
cin>>a>>b;
c=a;
a=b;
b=c;
cout<<a<<b;
}
``` |
#include<stdio.h>
char a[105];
char b[105];
int main(){
scanf("%s %s", a,b);
printf("%s%s", b, a);
return 0;
}
| ### Prompt
Construct a CPP code solution to the problem outlined:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include<stdio.h>
char a[105];
char b[105];
int main(){
scanf("%s %s", a,b);
printf("%s%s", b, a);
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main(){
string s,t;
cin>>s>>t;
cout<<t<<""<<s<<endl;
} | ### Prompt
Develop a solution in cpp to the problem described below:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
string s,t;
cin>>s>>t;
cout<<t<<""<<s<<endl;
}
``` |
#include<iostream>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
cout << T << S;
return 0;
} | ### Prompt
Your challenge is to write a CPP solution to the following problem:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include<iostream>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
cout << T << S;
return 0;
}
``` |
#include<bits/stdc++.h>
using namespace std;
string s,t;
int main()
{
cin>>s>>t;
cout<<t+s<<endl;
} | ### Prompt
Generate a Cpp solution to the following problem:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
string s,t;
int main()
{
cin>>s>>t;
cout<<t+s<<endl;
}
``` |
#include<bits/stdc++.h>
using namespace std;
int main ()
{
string s,t;
cin>>s;
cin>>t;
cout<< t+s;
return 0;
} | ### Prompt
Generate a cpp solution to the following problem:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include<bits/stdc++.h>
using namespace std;
int main ()
{
string s,t;
cin>>s;
cin>>t;
cout<< t+s;
return 0;
}
``` |
#include <iostream>
using namespace std;
string s, t;
int main() {
cin>> s>> t;
cout<< t<< s;
return 0;
} | ### Prompt
Please formulate a cpp solution to the following problem:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include <iostream>
using namespace std;
string s, t;
int main() {
cin>> s>> t;
cout<< t<< s;
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main(){
string T,S;
cin >> S >> T;
cout << T << S << endl;
} | ### Prompt
Construct a cpp code solution to the problem outlined:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main(){
string T,S;
cin >> S >> T;
cout << T << S << endl;
}
``` |
#include<iostream>
using namespace std;
char s[101],t[101];
int main(){
cin>>s>>t;
cout<<t<<s;
return 0;
} | ### Prompt
Generate a CPP solution to the following problem:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include<iostream>
using namespace std;
char s[101],t[101];
int main(){
cin>>s>>t;
cout<<t<<s;
return 0;
}
``` |
#include <iostream>
using namespace std;
int main() {
string s, str;
cin >> s >> str;
cout << str + s;
} | ### Prompt
Please provide a cpp coded solution to the problem described below:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include <iostream>
using namespace std;
int main() {
string s, str;
cin >> s >> str;
cout << str + s;
}
``` |
#include <iostream>
#include<string>
using namespace std;
int main(){
string s, t;
cin>>s>>t;
cout<<t<<s;
}
| ### Prompt
Your challenge is to write a cpp solution to the following problem:
Given are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.
Constraints
* S and T are strings consisting of lowercase English letters.
* The lengths of S and T are between 1 and 100 (inclusive).
Input
Input is given from Standard Input in the following format:
S T
Output
Print the resulting string.
Examples
Input
oder atc
Output
atcoder
Input
humu humu
Output
humuhumu
### Response
```cpp
#include <iostream>
#include<string>
using namespace std;
int main(){
string s, t;
cin>>s>>t;
cout<<t<<s;
}
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.