buggy_code stringlengths 11 625k | fixed_code stringlengths 17 625k | bug_type stringlengths 2 4.45k | language int64 0 8 | token_count int64 5 200k |
|---|---|---|---|---|
N, K = map(int, input().split())
A = set()
for _ in range(K):
d = int(input())
A.add(list(input().split()))
print(N - len(A))
| N, K = map(int, input().split())
A = set()
for _ in range(K):
d = int(input())
A.update(list(map(int, input().split())))
print(N - len(A))
| [["-", 8, 196, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 8, 196, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 61 |
n, k = map(int, input().split())
x = [0]*n
for i in range(k):
d = int(input())
a = list(map(int, input().split()))
for j in a:
x[j]=x[j]+1
print(x.count(0)) | n, k = map(int, input().split())
x = [0]*n
for i in range(k):
d = int(input())
a = list(map(int, input().split()))
for j in a:
x[j-1]=x[j-1]+1
print(x.count(0)) | [["+", 0, 1, 0, 662, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 662, 31, 206, 206, 657, 12, 612], ["+", 0, 662, 12, 657, 31, 206, 206, 657, 17, 33], ["+", 0, 662, 12, 657, 31, 206, 206, 657, 12, 612]] | 5 | 81 |
list($people, $type) = explode(' ',trim(fgets(STDIN)));
$input = [];
for ($i = 1; $i <= $type; $i++) {
$count = trim(fgets(STDIN));
$A = explode(' ',trim(fgets(STDIN)));
foreach ($A as $a) {
$input[$a] = 1;
}
}
printf("%d", $people-count($input));
| <?php
list($people, $type) = explode(' ',trim(fgets(STDIN)));
$input = [];
for ($i = 1; $i <= $type; $i++) {
$count = trim(fgets(STDIN));
$A = explode(' ',trim(fgets(STDIN)));
foreach ($A as $a) {
$input[$a] = 1;
}
}
printf("%d", $people-count($input));
| [["+", 36, 36, 36, 36, 36, 36, 0, 493, 0, 605]] | 6 | 113 |
N, K = map(int, input().split())
table = [[int(i) for i in input().split()] for _ in range(K * 2)]
ans_list = []
sunuke_set = set(list(range(1, K + 1)))
for i in range(1, K * 2 + 1, 2):
ans_list += table[i]
ans_set = set(ans_list)
print(len(sunuke_set - ans_set))
| N, K = map(int, input().split())
table = [[int(i) for i in input().split()] for _ in range(K * 2)]
ans_list = []
sunuke_set = set(list(range(1, N + 1)))
for i in range(1, K * 2 + 1, 2):
ans_list += table[i]
ans_set = set(ans_list)
print(len(sunuke_set - ans_set))
| [["-", 3, 4, 0, 652, 3, 4, 0, 657, 31, 22], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 31, 22]] | 5 | 102 |
#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, k;
cin >> n >> k;
int freq[k] = {0};
for (int i = 0; i < k; i++) {
int d;
cin >> d;
for (int i = 0; i < d; i++) {
int snuke;
cin >> snuke;
freq[snuke - 1]++;
}
}
int ans... | #include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, k;
cin >> n >> k;
int freq[n] = {0};
for (int i = 0; i < k; i++) {
int d;
cin >> d;
for (int i = 0; i < d; i++) {
int snuke;
cin >> snuke;
freq[snuke - 1]++;
}
}
int an... | [["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 22], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 141 |
n,k=map(int,input().split())
list_a=[]
for d in range(k):
d=int(input())
a=list(map(int,input().split()))
list_a.extend(a)
ans=0
for i in range(1,n):
if list_a.count(i)==0:
ans+=1
print(ans)
| n,k=map(int,input().split())
list_a=[]
for d in range(k):
d=int(input())
a=list(map(int,input().split()))
list_a.extend(a)
ans=0
for i in range(1,n+1):
if list_a.count(i)==0:
ans+=1
print(ans)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 89 |
N, K = map(int, input().split())
lst = []
for i in range(K):
d = int(input())
A = list(map(int, input().split()))
for char in A:
if char not in lst:
lst.append(char)
count = 0
for i in range(1, K+1):
if i not in lst:
count += 1
print(count) | N, K = map(int, input().split())
lst = []
for i in range(K):
d = int(input())
A = list(map(int, input().split()))
for char in A:
if char not in lst:
lst.append(char)
count = 0
for i in range(1, N+1):
if i not in lst:
count += 1
print(count) | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22]] | 5 | 98 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int n, k;
cin >> n >> k;
int d, a;
int sum = 0;
vector<int> flag(n, 0);
rep(i, k) {
cin >> d;
rep(i, d) {
cin >> a;
flag.at(a - 1) = 1;
}
}
rep(i, k) {
// cou... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int n, k;
cin >> n >> k;
int d, a;
int sum = 0;
vector<int> flag(n, 0);
rep(i, k) {
cin >> d;
rep(i, d) {
cin >> a;
flag.at(a - 1) = 1;
}
}
rep(i, n) {
// cou... | [["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78]] | 1 | 115 |
# 166 B
n, k = map(int, input().split())
l = []
for i in range(k):
d = int(input())
a = list(map(int, input().split()))
l = l + a
print(n-len(set(a))) | # 166 B
n, k = map(int, input().split())
l = []
for i in range(k):
d = int(input())
a = list(map(int, input().split()))
l = l + a
print(n-len(set(l))) | [["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22]] | 5 | 71 |
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include <tuple>
#include <... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include <tuple>
#include <... | [["-", 0, 27, 28, 69, 341, 342, 0, 16, 31, 22], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 31, 22]] | 1 | 415 |
n, k = map(int, input().split())
kouho = set(range(1, n))
for kashi in range(1, k):
a = input()
lst = map(int, input().split())
for b in lst:
kouho.discard(b)
print(len(kouho)) | n, k = map(int, input().split())
kouho = set(range(1, n + 1))
#print(kouho)
for kashi in range(1, k + 1):
a = input()
lst = map(int, input().split())
for b in lst:
kouho.discard(b)
print(len(kouho)) | [["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 74 |
n, k = map(int, input().split())
a = [x*0 for x in range(n)]
count = 0
for i in range(k):
d = int(input())
A = list(map(int, input().split()))
for j in range(d):
a[A[j]-1] += 1
print(a)
for t in range(n):
if a[t] == 0:
count += 1
print(count) | n, k = map(int, input().split())
a = [x*0 for x in range(n)]
count = 0
for i in range(k):
d = int(input())
A = list(map(int, input().split()))
for j in range(d):
a[A[j]-1] += 1
for t in range(n):
if a[t] == 0:
count += 1
print(count) | [["-", 0, 7, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 112 |
N,K=map(int,input().split())
cnt=[0]*N
for i in range(K):
d=int(input())
A=list(map(int(),input().split()))
for a in A:
cnt[a-1]=cnt[a-1]+1
ans=0
for i in range(N):
if cnt[i]==0:
ans=ans+1
print(ans)
| N,K=map(int,input().split())
cnt=[0]*N
for i in range(K):
d=int(input())
A=list(map(int,input().split()))
for a in A:
cnt[a-1]=cnt[a-1]+1
ans=0
for i in range(N):
if cnt[i]==0:
ans=ans+1
print(ans)
| [["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 106 |
def main():
n, k = map(int, input().split())
kids = list()
sum = 0
for i in k:
dustbox = input()
kids += list(map(int, input().split()))
for i in range(1, n+1):
if i not in kids:
sum += 1
print(sum)
main() | def main():
n, k = map(int, input().split())
kids = list()
sum = 0
for i in range(k):
dustbox = input()
kids += list(map(int, input().split()))
for i in range(1, n+1):
if i not in kids:
sum += 1
print(sum)
main() | [["+", 0, 14, 8, 196, 0, 7, 12, 652, 63, 22], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 24], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 25]] | 5 | 84 |
n, k = map(int, input().split())
kids = list()
for i in range(k):
d = input()
kids += list(map(int, input().split()))
res = 0
print(kids)
for i in range(1,n+1):
if i not in kids:
res+= 1
print(res) | n, k = map(int, input().split())
kids = list()
for i in range(k):
d = input()
kids += list(map(int, input().split()))
res = 0
for i in range(1,n+1):
if i not in kids:
res+= 1
print(res) | [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 83 |
n,k=map(int,input().split())
d=[]
l=[]
for i in range(k):
d=int(input())
l.append(map(int,input().split()))
x=set(l)
x=list(x)
print(n-len(x)) | n,k=map(int,input().split())
d=[]
l=[]
for i in range(k):
d=int(input())
l+=map(int,input().split())
x=set(l)
x=list(x)
print(n-len(x)) | [["-", 8, 196, 0, 1, 0, 652, 63, 319, 0, 131], ["-", 8, 196, 0, 1, 0, 652, 63, 319, 319, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 17, 107], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 78 |
#ABC166B_TrickorTrear.rb
n,k = gets.split.map(&:to_i)
ar = []
(1..k).each do |kk|
d = gets.chomp.to_i
a = gets.split.map(&:to_i)
ar << a
end
kashi = ar.flatten!.uniq!.size
puts n - kashi
| #ABC166B_TrickorTrear.rb
n,k = gets.split.map(&:to_i)
ar = []
(1..k).each do |kk|
d = gets.chomp.to_i
a = gets.split.map(&:to_i)
ar << a
end
kashi = ar.flatten.uniq.size
puts n - kashi
| [["-", 0, 662, 12, 652, 486, 652, 486, 652, 735, 22], ["+", 0, 662, 12, 652, 486, 652, 486, 652, 735, 22], ["-", 0, 493, 0, 662, 12, 652, 486, 652, 735, 22], ["+", 0, 493, 0, 662, 12, 652, 486, 652, 735, 22]] | 4 | 64 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
int n, k;
cin >> n >> k;
vector<int> p(n);
rep(i, k) {
int d;
cin >> d;
rep... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
int n, k;
cin >> n >> k;
vector<int> p(n);
rep(i, k) {
int d;
cin >> d;
rep... | [["-", 0, 27, 28, 69, 341, 342, 0, 16, 31, 22], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 31, 22]] | 1 | 134 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<int> list(n);
for (int i = 0; i < k; i++) {
int d;
cin >> d;
for (int j = 0; j < d; j++) {
int di;
cin >> di;
list[di - 1] = 1;
}
}
int cnt = 0;
for (int i = 0; i < k; i++) {
i... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<int> list(n);
for (int i = 0; i < k; i++) {
int d;
cin >> d;
for (int j = 0; j < d; j++) {
int di;
cin >> di;
list[di - 1] = 1;
}
}
int cnt = 0;
for (int i = 0; i < n; i++) {
i... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 128 |
n,k = map(int, input().split())
L = [list(map(int, input().split())) for i in range(2*k)]
A = []
for i in range(k-1):
A = A + L[2*i + 1]
ans = 0
for i in range(n):
if i+1 not in A:
ans += 1
print(ans) | n,k = map(int, input().split())
L = [list(map(int, input().split())) for i in range(2*k)]
A = []
for i in range(k):
A = A + L[2*i + 1]
ans = 0
for i in range(n):
if i+1 not in A:
ans += 1
print(ans)
| [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 96 |
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
typedef long long int ll;
#define EPS (1e-9... | #include <algorithm>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
typedef long long int ll;
#define EPS (1e-9... | [["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78]] | 1 | 222 |
N, K = map(int, input().split())
sweet = [0 for i in range(N)]
for i in range(K):
input()
for j in map(int, input().split()):
sweet[j] = 1
cnt = 0
for k in sweet:
if k == 0:
cnt += 1
print(cnt) | N, K = map(int, input().split())
sweet = [0 for i in range(N)]
for i in range(K):
s = input()
for j in map(int, input().split()):
sweet[j-1] = 1
cnt = 0
for k in sweet:
if k == 0:
cnt += 1
print(cnt)
| [["+", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 1, 0, 662, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 662, 31, 206, 206, 657, 12, 612]] | 5 | 81 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
vector<int> vec(N + 1);
for (int i = 0; i < K; i++) {
int d;
cin >> d;
for (int i = 0; i < d; i++) {
int x;
cin >> x;
vec.at(x) += 1;
}
}
int sum = 0;
for (int i = 1; i < N; i++) {
i... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
vector<int> vec(N + 1);
for (int i = 0; i < K; i++) {
int d;
cin >> d;
for (int i = 0; i < d; i++) {
int x;
cin >> x;
vec.at(x) += 1;
}
}
int sum = 0;
for (int i = 1; i <= N; i++) {
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 131 |
n,k=map(int,input().split())
l=[]
count=0
for _ in range(k):
d=int(input())
a=list(map(int,input().split()))
l+=a
for i in range(1,n+1):
if i in l:
count+=1
print(count) | n,k=map(int,input().split())
l=[]
count=0
for _ in range(k):
d=int(input())
a=list(map(int,input().split()))
l+=a
for i in range(1,n+1):
if i not in l:
count+=1
print(count)
| [["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 699]] | 5 | 83 |
N,K=map(int,input().split())
s={i+1 for i in range(N)}
t={}
for i in range(K):
input()
t|=set(map(int,input().split()))
print(len(s-t)) | N,K=map(int,input().split())
s={i+1 for i in range(N)}
t=set()
for i in range(K):
input()
t|=set(map(int,input().split()))
print(len(s-t)) | [["-", 0, 656, 0, 1, 0, 662, 12, 680, 0, 45], ["-", 0, 656, 0, 1, 0, 662, 12, 680, 0, 46], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]] | 5 | 71 |
#include <bits/stdc++.h>
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define precise(i) fixed << setprecision(i)
using ul = uint32_t;
using ull = uint64_t;
using namespace std;
int main() {
fastIO;
int n, k, d;
cin >> n >> k >> d;
vect... | #include <bits/stdc++.h>
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define precise(i) fixed << setprecision(i)
using ul = uint32_t;
using ull = uint64_t;
using namespace std;
int main() {
fastIO;
int n, k, d;
cin >> n >> k;
vector<bo... | [["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]] | 1 | 154 |
#include <stdio.h>
void shokika(int x[], int a) {
for (int i = 0; i < a; i++) {
x[i] = 0;
}
}
int main(void) {
int n, k, d;
int ai;
scanf("%d", &n);
int a[n];
shokika(a, n);
scanf("%d", &k);
for (int i = 0; i < k; i++) {
scanf("%d", &d);
for (int j = 0; j < d; j++) {
scanf("%d", &ai... | #include <stdio.h>
void shokika(int x[], int a) {
for (int i = 0; i < a; i++) {
x[i] = 0;
}
}
int main(void) {
int n, k, d;
int ai;
scanf("%d", &n);
int a[n];
shokika(a, n);
scanf("%d", &k);
for (int i = 0; i < k; i++) {
scanf("%d", &d);
for (int j = 0; j < d; j++) {
scanf("%d", &ai... | [["+", 0, 1, 0, 11, 31, 69, 71, 16, 17, 33], ["+", 0, 1, 0, 11, 31, 69, 71, 16, 12, 13]] | 0 | 198 |
N,K = map(int,input().split())
list1 ={i for i in range(1,N)}
list2 = set()
for i in range(K):
NN = int(input())
MM = map(int,input().split())
for j in MM:
list2.add(j)
ans = list1 -list2
print(len(ans))
| N,K = map(int,input().split())
list1 ={i for i in range(1,N+1)}
list2 = set()
for i in range(K):
NN = int(input())
MM = map(int,input().split())
for j in MM:
list2.add(j)
ans = list1 -list2
print(len(ans)) | [["+", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 88 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int N, K, d, a, ans = 0;
cin >> N >> K;
vector<int> A(N, 1);
for (int i = 0; i < K; ++i) {
cin >> d;
for (int j = 0; j < d; ++j) {
cin >> a;
A[a] -= 1;
}
}
rep(i, N) {
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int N, K, d, a, ans = 0;
cin >> N >> K;
vector<int> A(N, 1);
for (int i = 0; i < K; ++i) {
cin >> d;
for (int j = 0; j < d; ++j) {
cin >> a;
A[a - 1] -= 1;
}
}
rep(i, N)... | [["+", 0, 11, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 11, 31, 69, 341, 342, 0, 16, 12, 13]] | 1 | 128 |
n,k=gets.chomp.split(' ').map(&:to_i)
ans = [*(1..n)]
k.times do
gets
candy = gets.chomp.split(' ').map(&:to_i)
candy.each do |c|
if ans.include?(c)
ans.delete(c)
end
end
end
puts ans | n,k=gets.chomp.split(' ').map(&:to_i)
ans = [*(1..n)]
k.times do
gets
candy = gets.chomp.split(' ').map(&:to_i)
candy.each do |c|
if ans.include?(c)
ans.delete(c)
end
end
end
puts ans.size | [["+", 0, 493, 0, 652, 3, 4, 0, 652, 17, 131], ["+", 0, 493, 0, 652, 3, 4, 0, 652, 735, 22]] | 4 | 78 |
/*
author : Nishikawa
created: 10.08.2020 13:05:55
*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
int main() {
int n, k;
cin >> n >> k;
vector<bool> have(n, true);
for (int i = 0; i < k; i++) {
int d;
cin >> d;
for (... | /*
author : Nishikawa
created: 10.08.2020 13:05:55
*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
int main() {
int n, k;
cin >> n >> k;
vector<bool> have(n, true);
for (int i = 0; i < k; i++) {
int d;
cin >> d;
for (... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 144 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, K, ans = 0;
cin >> N >> K;
vector<int> vec(K + 1);
for (int i = 0; i < K; i++) {
int d;
cin >> d;
for (int j = 0; j < d; j++) {
int a;
cin >> a;
vec[a - 1] = 1;
}
}
for (int i = 0; i < N; i++) {
if (vec[... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K, ans = 0;
cin >> N >> K;
vector<int> vec(N, 0);
for (int i = 0; i < K; i++) {
int d;
cin >> d;
for (int j = 0; j < d; j++) {
int a;
cin >> a;
vec[a - 1] = 1;
}
}
for (int i = 0; i < N; i++) {
if (vec[i... | [["-", 0, 43, 49, 50, 51, 4, 0, 16, 31, 22], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 21], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13]] | 1 | 129 |
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
static const ll MAX = 1000000000000000;
static const int NIL = -1;
using namespace std;
const long double EPS = 0.0000000001;
const long double PI = (acos(-1));
const int MOD = 1000000007;
int ... | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
static const ll MAX = 1000000000000000;
static const int NIL = -1;
using namespace std;
const long double EPS = 0.0000000001;
const long double PI = (acos(-1));
const int MOD = 1000000007;
int ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 178 |
n,k =map(int,input().split())
D=[]
A=[]
C=[]
for i in range(k):
D.append(int(input()))
A.append(list(map(int,input().split())))
for i in range(1,n+1):
C.append(int(i))
for i in range(k-1):
for a in A[i]:
if C.count(a)!=0:
C.remove(a)
print( len(C) )
| n,k =map(int,input().split())
D=[]
A=[]
C=[]
for i in range(k):
D.append(int(input()))
A.append(list(map(int,input().split())))
for i in range(1,n+1):
C.append(int(i))
for i in range(k):
for a in A[i]:
if C.count(a)!=0:
C.remove(a)
print( len(C) )
| [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 129 |
n, k = map(int,input().split())
d = []
a = []
for i in range(1,k+1):
d.append(int(input()))
a_temp = list(map(int,input().split()))
a.append(a_temp)
num = []
for i in range(n):
cnt = 0
for j in range(k):
if i in a[j]:
cnt += 1
if cnt == 0:
num.append(i)
print(le... | n, k = map(int,input().split())
d = []
a = []
for i in range(1,k+1):
d.append(int(input()))
a_temp = list(map(int,input().split()))
a.append(a_temp)
num = []
for i in range(n):
cnt = 0
for j in range(k):
if i+1 in a[j]:
cnt += 1
if cnt == 0:
num.append(i)
print(... | [["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 12, 612]] | 5 | 122 |
n,k = map(int,input().split())
a = [0]*n
for _ in range(k):
kind = int(input())
for i in list(map(int,input().split())):
a[i-1] += 1
print(a.count(0) if 0 not in a else 0)
| n,k = map(int,input().split())
a = [0]*n
for _ in range(k):
kind = int(input())
for i in list(map(int,input().split())):
a[i-1] += 1
print(a.count(0) if 0 in a else 0) | [["-", 0, 652, 3, 4, 0, 41, 0, 666, 667, 699]] | 5 | 82 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
// using ll = long long;
// using P = pair<int,int>;
int main() {
int n, k;
cin >> n >> k;
vector<int> d(n);
rep(i, k) {
int m;
cin >> m;
rep(j, m) {
int a;
cin >> a;
d.at(j - 1) = 1;
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
// using ll = long long;
// using P = pair<int,int>;
int main() {
int n, k;
cin >> n >> k;
vector<int> d(n);
rep(i, k) {
int m;
cin >> m;
rep(j, m) {
int a;
cin >> a;
d.at(a - 1) = 1;
... | [["-", 0, 11, 31, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 11, 31, 2, 3, 4, 0, 16, 31, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]] | 1 | 115 |
def resolve():
N, K = map(int, input().split())
A = []
for i in range(K):
d = int(input())
a = map(int, input().split())
A.append(a)
print(N - len(set(A)))
resolve() | def resolve():
N, K = map(int, input().split())
A = []
for i in range(K):
d = int(input())
a = list(map(int, input().split()))
A.extend(a)
print(N - len(set(A)))
resolve() | [["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["-", 8, 196, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 8, 196, 0, 1, 0, 652, 63, 319, 319, 22]] | 5 | 76 |
import sys
read = sys.stdin.readline
import time
import math
import itertools as it
def inp():
return int(input())
def inpl():
return list(map(int, input().split()))
start_time = time.perf_counter()
# ------------------------------
N, K = inpl()
dp = [False] * N
for i in range(K):
d = inp()
A = inpl()
... | import sys
read = sys.stdin.readline
import time
import math
import itertools as it
def inp():
return int(input())
def inpl():
return list(map(int, input().split()))
start_time = time.perf_counter()
# ------------------------------
N, K = inpl()
dp = [False] * N
for i in range(K):
d = inp()
A = inpl()
... | [["-", 0, 1, 0, 662, 31, 206, 206, 657, 31, 22], ["+", 0, 1, 0, 662, 31, 206, 206, 657, 31, 22]] | 5 | 146 |
//インクルード(アルファベット順)
#include <algorithm> //sort,二分探索,など
#include <bitset> //固定長bit集合
#include <chrono> //実行時間計測
#include <cmath> //pow,logなど
#include <complex> //複素数
#include <deque> //両端アクセスのキュー
#include <functional> //sortのgreater
#include <iomanip> //setprecision(浮動小数点... | //インクルード(アルファベット順)
#include <algorithm> //sort,二分探索,など
#include <bitset> //固定長bit集合
#include <chrono> //実行時間計測
#include <cmath> //pow,logなど
#include <complex> //複素数
#include <deque> //両端アクセスのキュー
#include <functional> //sortのgreater
#include <iomanip> //setprecision(浮動小数点... | [["-", 8, 9, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 8, 9, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 8, 9, 0, 9, 0, 1, 0, 16, 12, 22], ["+", 8, 9, 0, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22]] | 1 | 278 |
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#l = list(map(int, input().split()))
n, k = map(int, input().split())
temp = [0] * n
for i in range(k):
d = int(input())
l = list(map(int, input().split()))
for j in range(d):
temp[j-1] += 1
ans = 0
for i in temp:
if (i == 0):
... | #k = int(input())
#s = input()
#a, b = map(int, input().split())
#l = list(map(int, input().split()))
n, k = map(int, input().split())
temp = [0] * n
for i in range(k):
d = int(input())
l = list(map(int, input().split()))
for j in l:
temp[j-1] += 1
ans = 0
for i in temp:
if (i == 0):
... | [["-", 0, 7, 8, 196, 0, 7, 12, 652, 63, 22], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 25], ["+", 0, 656, 0, 7, 8, 196, 0, 7, 12, 22]] | 5 | 98 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int main() {
int n, k;
cin >> n >> k;
vector<int> tmp(n);
rep(i, k) {
int d;
cin >> d;
rep(j, d) {
int a;
cin >> a;
tmp.at(d - 1) = 1;
}
}
int cnt = 0;
rep... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int main() {
int n, k;
cin >> n >> k;
vector<int> tmp(n);
rep(i, k) {
int d;
cin >> d;
rep(j, d) {
int a;
cin >> a;
tmp.at(a - 1) = 1;
}
}
int cnt = 0;
rep... | [["-", 0, 11, 31, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 11, 31, 2, 3, 4, 0, 16, 31, 22]] | 1 | 123 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int n, k, cnt = 0;
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 a;
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int n, k, cnt = 0;
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 a;
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 148 |
N,K = gets.split.map &:to_i
p ((1..K).to_a - K.times.map{ gets; gets.split.map &:to_i }.flatten.uniq.sort).count | N,K = gets.split.map &:to_i
p ((1..N).to_a - K.times.map{ gets; gets.split.map &:to_i }.flatten.uniq.sort).count | [["-", 0, 738, 31, 652, 486, 739, 0, 475, 444, 743], ["+", 0, 738, 31, 652, 486, 739, 0, 475, 444, 743]] | 4 | 46 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
int arr[n];
for (int i = 0; i < k; i++) {
arr[i] = 0;
}
for (int i = 0; i < k; i++) {
int n1;
cin >> n1;
for (int j = 0; j < n1; j++) {
int x;
cin >> x;
arr[x - 1]++;
}
}
int a... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
int arr[n];
for (int i = 0; i < n; i++) {
arr[i] = 0;
}
for (int i = 0; i < k; i++) {
int n1;
cin >> n1;
for (int j = 0; j < n1; j++) {
int x;
cin >> x;
arr[x - 1]++;
}
}
int a... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 154 |
n,k = map(int,input().split())
count = [0]*(n+1)
count1 = 0
for i in range(k):
d = int(input())
A = list(map(int,input().split()))
for i in A:
count[i-1] += 1
for i in range(n):
if count[i] == 0:
count1 += 1
print(count)
print(count1) | n,k = map(int,input().split())
count = [0]*(n+1)
count1 = 0
for i in range(k):
d = int(input())
A = list(map(int,input().split()))
for i in A:
count[i-1] += 1
for i in range(n):
if count[i] == 0:
count1 += 1
print(count1)
| [["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24]] | 5 | 103 |
# B Trick or Treat
N, K = map(int, input().split())
sunuke = [0] * N
for i in k:
d = int(input())
a = list(map(int, input().split()))
for ai in a:
sunuke[ai-1] += 1
print(sunuke.count(0))
| # B Trick or Treat
N, K = map(int, input().split())
sunuke = [0] * N
for i in range(K):
d = int(input())
a = list(map(int, input().split()))
for ai in a:
sunuke[ai-1] += 1
print(sunuke.count(0)) | [["-", 36, 36, 36, 36, 0, 656, 0, 7, 12, 22], ["+", 36, 36, 0, 656, 0, 7, 12, 652, 63, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 25]] | 5 | 76 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
int a[n] = {false};
for (int i = 0; i < k; i++) {
int s;
cin >> s;
for (int j = 0; j < s; j++) {
int A;
cin >> A;
a[A] = true;
}
}
int count = 0;
for (int i = 1; i <= n; i++) {
if (a[i... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
int a[n + 1] = {false};
for (int i = 0; i < k; i++) {
int s;
cin >> s;
for (int j = 0; j < s; j++) {
int A;
cin >> A;
a[A] = true;
}
}
int count = 0;
for (int i = 1; i <= n; i++) {
if ... | [["+", 0, 43, 49, 50, 49, 80, 81, 16, 17, 72], ["+", 0, 43, 49, 50, 49, 80, 81, 16, 12, 13], ["-", 51, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["-", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13]] | 1 | 127 |
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <unordered_set>
#define ll long long
using namespace std;
const double pi = 3.14159265358979323846;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N, K, d;
cin >> N >> K;
vector<vector<int>> g(N + 1);
for (int... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <unordered_set>
#define ll long long
using namespace std;
const double pi = 3.14159265358979323846;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N, K, d;
cin >> N >> K;
vector<vector<int>> g(N + 1);
for (int... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 181 |
n,k = map(int, input().split())
# お菓子を持っているすぬけ君かを判断する配列d 1ならもってる 0はもってない
d = [0] * n
# お菓子iを持っているのはどのすぬけ君か?
for i in range(k):
# お菓子iを持っている人数m人
m = int(input())
# お菓子iを持っているすぬけ君のリスト
a = list(map(int, input().split()))
for j in a:
# すぬけ君a[j]は少なくとも一つ以上のお菓子を持っている
d[a[j]-1] = 1
... | # ABC166 B
n,k = map(int, input().split())
# お菓子を持っているすぬけ君かを判断する配列d 1ならもってる 0はもってない
d = [0] * n
# お菓子iを持っているのはどのすぬけ君か?
for i in range(k):
# お菓子iを持っている人数m人
m = int(input())
# お菓子iを持っているすぬけ君のリスト
a = list(map(int, input().split()))
for j in a:
# すぬけ君a[j]は少なくとも一つ以上のお菓子を持っている
d[j-1] = 1
... | [["-", 0, 662, 31, 206, 206, 657, 31, 206, 51, 22], ["-", 0, 662, 31, 206, 206, 657, 31, 206, 0, 70], ["-", 0, 662, 31, 206, 206, 657, 31, 206, 0, 73]] | 5 | 104 |
N, K = map(int, input().split())
tmp = set()
for i in range(K):
input()
tmp |= set(input())
print(N - len(tmp) + 1) | N, K = map(int, input().split())
tmp = set()
for i in range(K):
input()
tmp |= set(input().split())
print(N - len(tmp))
| [["+", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]] | 5 | 51 |
N, K = map(int, input().split())
tmp = [0] * N
for i in range(K):
input()
for j in map(int, input().split()):
tmp[j] |= 1
print(sum(tmp)) | N, K = map(int, input().split())
tmp = [0] * N
for i in range(K):
input()
for j in map(int, input().split()):
tmp[j-1] |= 1
print(N - sum(tmp))
| [["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33]] | 5 | 63 |
N, K = map(int, input().split())
tmp = set()
for i in range(N):
input()
tmp |= set(map(int, input().split()))
print(len(set(range(1, N+1)) - tmp)) | N, K = map(int, input().split())
tmp = set()
for i in range(K):
input()
tmp |= set(map(int, input().split()))
print(len(set(range(1, N+1)) - tmp)) | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22]] | 5 | 68 |
(n, k) = [int(x) for x in input().split()]
s = set()
for i in range(k):
input()
s |= set(input().split)
print(n-len(s))
| (n, k) = [int(x) for x in input().split()]
s = set()
for i in range(k):
input()
s |= set(input().split())
print(n-len(s))
| [["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 57 |
N, K = map(int,input().split())
C = [0 for _ in range(N)]
ct = N
for i in range(N):
d = int(input())
A = list(map(int, input().split()))
for a in A:
if C[a-1] == 0:
C[a-1] += 1
ct -= 1
print(ct)
| N, K = map(int,input().split())
C = [0 for _ in range(N)]
ct = N
for i in range(K):
d = input()
A = list(map(int, input().split()))
for a in A:
if C[a-1] == 0:
C[a-1] += 1
ct -= 1
print(ct)
| [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 94 |
N,K = map(int,input().split())
S = set()
for n in range(N):
input()
S|=set(input().split())
print(N-len(S)) | N,K = map(int,input().split())
S = set()
for k in range(K):
input()
S|=set(input().split())
print(N-len(S)) | [["-", 36, 36, 36, 36, 0, 656, 0, 7, 31, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 7, 31, 22], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22]] | 5 | 53 |
n, k = map(int, input().split())
n_list = [1]*n
for _ in range(k):
_ = input()
for i in range(list(map(int, input().split()))):
n_list[i-1] = 0
print(sum(n_list))
| n, k = map(int, input().split())
n_list = [1]*n
for _ in range(k):
_ = input()
for i in list(map(int, input().split())):
n_list[i-1] = 0
print(sum(n_list))
| [["-", 0, 7, 8, 196, 0, 7, 12, 652, 63, 22], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 73 |
N , K = map(int, input().split())
has = set()
for _ in range(K):
d = int(input())
has = set(map(int, input().split()))
print(N - len(has)) | N , K = map(int, input().split())
has = set()
for _ in range(K):
d = int(input())
has |= set(map(int, input().split()))
print(N - len(has)) | [["-", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 17, 160]] | 5 | 63 |
def main():
N, K = map(int, input().split(' '))
d = [0] * N
total = 0
for i in range(K):
A = input()
B = list(map(int, input().split(' ')))
for j in B:
d[j - 1] = 1
for j in range(K):
if d[j] == 0:
total += 1
print(total)
main() | def main():
N, K = map(int, input().split(' '))
d = [0] * N
total = 0
for i in range(K):
A = input()
B = list(map(int, input().split(' ')))
for j in B:
d[j - 1] = 1
for j in range(N):
if d[j] == 0:
total += 1
print(total)
main() | [["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 22]] | 5 | 106 |
n,k = map(int,input().split())
d = [0]*k
a = [0]*k
s = []
for i in range(k):
d[i] = int(input())
a[i] = list(map(int,input().split()))
s.extend(a[i])
d = set(s)
print(n-len(d))
print(s) | n,k = map(int,input().split())
d = [0]*k
a = [0]*k
s = []
for i in range(k):
d[i] = int(input())
a[i] = list(map(int,input().split()))
s.extend(a[i])
d = set(s)
print(n-len(d)) | [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 101 |
import sys
def Ii():return int(sys.stdin.buffer.readline())
def Mi():return map(int,sys.stdin.buffer.readline().split())
def Li():return list(map(int,sys.stdin.buffer.readline().split()))
n,k = Mi()
b = [1]*n
for i in range(k):
d = Ii()
a = Li()
for j in a:
b[j] = 0
print(sum(b)-1) | import sys
def Ii():return int(sys.stdin.buffer.readline())
def Mi():return map(int,sys.stdin.buffer.readline().split())
def Li():return list(map(int,sys.stdin.buffer.readline().split()))
n,k = Mi()
b = [1]*(n+1)
for i in range(k):
d = Ii()
a = Li()
for j in a:
b[j] = 0
print(sum(b)-1) | [["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 17, 72], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25]] | 5 | 123 |
N,K=map(int,input().split())
arr=[]
ans=[str(i) for i in range(1,N+1)]
for i in range(K):
_=input()
arr.extend((input().split()))
arr=list(set(arr))
p=0
for n in ans:
if(n in arr) :
p=p+1
print(p)
| N,K=map(int,input().split())
arr=[]
ans=[str(i) for i in range(1,N+1)]
for i in range(K):
_=input()
arr.extend((input().split()))
arr=list(set(arr))
p=0
for n in ans:
if(not(n in arr) ) :
p=p+1
print(p)
| [["+", 8, 196, 0, 57, 15, 23, 0, 681, 0, 372], ["+", 0, 57, 15, 23, 0, 681, 28, 23, 0, 24], ["+", 0, 57, 15, 23, 0, 681, 28, 23, 0, 25]] | 5 | 99 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, n, op) for (int i = a; i < (int)(n); i##op##op)
#define cout(val) cout << val << endl
using namespace std;
int main() {
int n, k, d, a, count = 0;
cin >> n >> k;
vector<bool> data(n, true);
rep(i, k) {
cin >> d... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, n, op) for (int i = a; i < (int)(n); i##op##op)
#define cout(val) cout << val << endl
using namespace std;
int main() {
int n, k, d, a, count = 0;
cin >> n >> k;
vector<bool> data(n, true);
rep(i, k) {
cin >> d... | [["+", 0, 14, 8, 9, 0, 14, 8, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 14, 8, 9, 0, 46]] | 1 | 126 |
n,k = map(int,input().split())
sunukes = list()
for i in range(1,k+1):
sunukes.append(i)
sunukes = set(sunukes)
for i in range(1,k+1):
input()
sunukes = sunukes - set(map(int,input().split()))
print(len(sunukes))
| n,k = map(int,input().split())
sunukes = list()
for i in range(1,n+1):
sunukes.append(i)
sunukes = set(sunukes)
for i in range(1,k+1):
input()
sunukes = sunukes - set(map(int,input().split()))
print(len(sunukes))
| [["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22]] | 5 | 86 |
n,k=map(int,input().split())
x=[0]*n
for i in range(k):
y=int(input())
z=list(map(int,input().split()))
for j in z:
x[j-1] +=1
a=0
for b in x:
if b==0:
c+=1
print(c) | n,k=map(int,input().split())
x=[0]*n
for i in range(k):
y=int(input())
z=list(map(int,input().split()))
for j in z:
x[j-1] +=1
a=0
for b in x:
if b==0:
a+=1
print(a) | [["-", 0, 57, 64, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 31, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]] | 5 | 89 |
N,K = map(int,input().split())
Data = [0]*N
print(K)
for k in range(K):
_ = input()
user = list(map(int,input().split()))
for u in user:
Data[u-1] += 1
ans = 0
for i in range(N):
if Data[i] == 0:
ans += 1
print(ans) | N,K = map(int,input().split())
Data = [0]*N
for k in range(K):
_ = input()
user = list(map(int,input().split()))
for u in user:
Data[u-1] += 1
ans = 0
for i in range(N):
if Data[i] == 0:
ans += 1
print(ans) | [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 96 |
N, K = map(int, input().split())
S = [1] * N
for i in range(K):
d = int(input())
t = map(int, input().split())
for i in range(t):
S[i-1] = 0
print(sum(S)) | N, K = map(int, input().split())
#お菓子を持っていない : 1
#お菓子を持っている : 0
#持っていない人を最終的に導くから
S = [1] * N
for i in range(K):
d = int(input())
t = map(int, input().split())
for i in t:
#i-1なのは添字と要素tが1ぶんずれているから
S[i-1] = 0
print(sum(S)) | [["-", 0, 7, 8, 196, 0, 7, 12, 652, 63, 22], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 25]] | 5 | 76 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
vector<int> v(N, 1);
for (int i = 0; i < K; i++) {
int d;
cin >> d;
for (int j = 0; j < d; j++) {
int ak;
cin >> ak;
v[ak - 1] = 0;
}
}
int sum = 0;
for (int i = 0; i < K; i++) {
sum +... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
vector<int> v(N, 1);
for (int i = 0; i < K; i++) {
int d;
cin >> d;
for (int j = 0; j < d; j++) {
int ak;
cin >> ak;
v[ak - 1] = 0;
}
}
int sum = 0;
for (int i = 0; i < N; i++) {
sum +... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 123 |
n,k = [int(x) for x in input().split(' ')]
def solve(n, k):
snukes = [None] * n
victims = 0
for i in range(k):
snacks = int(input())
snukes_snacks = [int(z) for z in input().split(' ')]
for j in range(snacks):
snukes[snukes_snacks[j] - 1] = snukes_snacks[j]
... | n,k = [int(x) for x in input().split(' ')]
def solve(n, k):
snukes = [None] * n
victims = 0
for i in range(k):
snacks = int(input())
snukes_snacks = [int(z) for z in input().split(' ')]
for j in range(snacks):
snukes[snukes_snacks[j] - 1] = snukes_snacks[j]
... | [["-", 0, 14, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 133 |
N, K = gets.split.map(&:to_i)
cnt = [0]*n
K.times do
d = gets.to_i
a = gets.split.map(&:to_i)
a.each do |v|
cnt[v-1] += 1
end
end
p cnt.select{|v| v==0}.size | N, K = gets.split.map(&:to_i)
cnt = [0]*N
K.times do
d = gets.to_i
a = gets.split.map(&:to_i)
a.each do |v|
cnt[v-1] += 1
end
end
p cnt.select{|v| v==0}.size
| [["-", 36, 36, 0, 493, 0, 662, 12, 738, 12, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 738, 12, 743]] | 4 | 71 |
#include <bits/stdc++.h>
using namespace std;
// def
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
#define repeat(i, a, b) for (int i = (a); i < (b); i++)
#define revrepeat(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define revre... | #include <bits/stdc++.h>
using namespace std;
// def
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
#define repeat(i, a, b) for (int i = (a); i < (b); i++)
#define revrepeat(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define revre... | [["+", 0, 14, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 431 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
int main() {
int n, k;
cin >> n >> k;
set<int> s;
rep(i, k) {
int d;
cin >> d;
rep(j, d) {
int a;
cin >> a;
s.insert(d);
}
}
cout << n - s.size() << endl;
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
int main() {
int n, k;
cin >> n >> k;
set<int> s;
rep(i, k) {
int d;
cin >> d;
rep(j, d) {
int a;
cin >> a;
s.insert(a);
}
}
cout << n - s.size() << endl;
... | [["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]] | 1 | 94 |
N, K = map(int, input().split())
check = [0] * N
for i in range(K):
d_i = int(input())
A_i = map(int, input().split())
for j in A_i:
check[j] = 1
print(sum(1 for x in check if x == 0))
| N, K = map(int, input().split())
check = [0] * N
for i in range(K):
d_i = int(input())
A_i = map(int, input().split())
for j in A_i:
check[j-1] = 1
print(sum(1 for x in check if x == 0))
| [["+", 0, 1, 0, 662, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 662, 31, 206, 206, 657, 12, 612]] | 5 | 79 |
from collections import Counter
N, K = map(int, input().split())
l = []
counter = 0
for k in range(K):
d = int(input())
A = map(int, input().split())
l.extend(A)
for i in range(1,K+1):
if Counter(l)[i]==0:
counter += 1
else:
continue
print(counter)
| from collections import Counter
N, K = map(int, input().split())
l = []
counter = 0
for k in range(K):
d = int(input())
A = map(int, input().split())
l.extend(A)
for i in range(1,N+1):
if Counter(l)[i]==0:
counter += 1
else:
continue
print(counter) | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22]] | 5 | 96 |
# B
n, k = map(int, input().split())
d = []
a = []
people = [0] * n
for i in range(k):
d.append(int(input()))
a.append(list(map(int, input().split())))
# print(a)
for i in range(k):
for j in range(d[i]):
# print(d[i])
people[j - 1] += 1
ans = 0
# print(people)
for i in people:
if i == 0:... | # B
n, k = map(int, input().split())
d = []
a = []
people = [0] * n
for i in range(k):
d.append(int(input()))
a.append(list(map(int, input().split())))
# print(a)
for i in range(k):
for j in range(d[i]):
# print(d[i])
people[a[i][j]-1] += 1
ans = 0
# print(people)
for i in people:
if i =... | [["+", 31, 206, 206, 657, 31, 206, 51, 206, 51, 22], ["+", 31, 206, 206, 657, 31, 206, 51, 206, 0, 70], ["+", 31, 206, 206, 657, 31, 206, 51, 206, 206, 22], ["+", 31, 206, 206, 657, 31, 206, 51, 206, 0, 73], ["+", 0, 677, 31, 206, 206, 657, 31, 206, 0, 70], ["+", 0, 677, 31, 206, 206, 657, 31, 206, 0, 73]] | 5 | 121 |
N, K = [int(i) for i in input().split()]
result = []
for i in range(K):
d = int(input())
x = [int(i) for i in input().split()]
for i in x:
if x not in result:
result.append(x)
print(N - len(result)) | N, K = [int(i) for i in input().split()]
result = []
for i in range(K):
d = int(input())
x = [int(i) for i in input().split()]
for i in x:
if i not in result:
result.append(i)
print(N - len(result)) | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22]] | 5 | 84 |
#include <stdio.h>
#include <string.h>
int main(void) {
int i, j, n, k, d, b, c;
int a[100];
scanf("%d %d", &n, &k);
for (i = 0; i < n; i++)
a[i] = 0;
for (j = 0; j < k; j++) {
scanf("%d", &d);
for (i = 0; i < d; i++) {
scanf("%d", &b);
a[b] = 1;
}
}
c = 0;
for (i = 0; i ... | #include <stdio.h>
#include <string.h>
int main(void) {
int i, j, n, k, d, b, c;
int a[100];
scanf("%d %d", &n, &k);
for (i = 0; i < n; i++)
a[i] = 0;
for (j = 0; j < k; j++) {
scanf("%d", &d);
for (i = 0; i < d; i++) {
scanf("%d", &b);
a[b - 1] = 1;
}
}
c = 0;
for (i = 0... | [["+", 0, 1, 0, 11, 31, 69, 71, 16, 17, 33], ["+", 0, 1, 0, 11, 31, 69, 71, 16, 12, 13]] | 0 | 164 |
n,k = map(int,input().split())
a = [i for i in range(n+1)]
d = []
A = []
for j in range(k):
d.append(int(input()))
A.append(list(map(int,input().split())))
print(d,A)
for i in A:
for j in i:
if j in a:
a.remove(j)
print(len(a)-1) | n,k = map(int,input().split())
a = [i for i in range(n+1)]
d = []
A = []
for j in range(k):
d.append(int(input()))
A.append(list(map(int,input().split())))
for i in A:
for j in i:
if j in a:
a.remove(j)
print(len(a)-1) | [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 113 |
n, k = map(lambda x: int(x), input().split(' '))
sunukes = [0] * int(n)
for i in range(1, k):
d = input()
A = map(lambda x: int(x), input().split(' '))
for a in A:
sunukes[a - 1] = 1
result = sunukes.count(0)
print(result) | n, k = map(lambda x: int(x), input().split(' '))
sunukes = [0] * int(n)
for i in range(1, k + 1):
d = input()
A = map(lambda x: int(x), input().split(' '))
for a in A:
sunukes[a - 1] = 1
result = sunukes.count(0)
print(result)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 98 |
#include <iostream>
using namespace std;
int main(void) {
int ct = 0;
int N, K;
int d;
int A[100];
int sunuke;
for (int k = 0; k < 100; k++) {
A[k] = 0;
}
cin >> N >> K;
for (int i = 0; i < K; i++) {
cin >> d;
for (int j = 0; j < d; j++) {
cin >> sunuke;
A[sunuke - 1]++;
... | #include <iostream>
using namespace std;
int main(void) {
int ct = 0;
int N, K;
int d;
int A[100];
int sunuke;
for (int k = 0; k < 100; k++) {
A[k] = 0;
}
cin >> N >> K;
for (int i = 0; i < K; i++) {
cin >> d;
for (int j = 0; j < d; j++) {
cin >> sunuke;
A[sunuke - 1]++;
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 153 |
#include <iostream>
using namespace std;
int check[100];
int main() {
int n, k, a, t;
cin >> n >> k;
for (int i = 0; i < k; i++) {
cin >> a;
for (int j = 0; j < a; j++) {
cin >> t;
check[--t]++;
}
}
int c = 0;
for (int i = 0; i < n; i++) {
if (check[i] != 0)
c++;
}
prin... | #include <iostream>
using namespace std;
int check[100];
int main() {
int n, k, a, t;
cin >> n >> k;
for (int i = 0; i < k; i++) {
cin >> a;
for (int j = 0; j < a; j++) {
cin >> t;
check[--t]++;
}
}
int c = 0;
for (int i = 0; i < n; i++) {
if (!check[i])
c++;
}
printf("... | [["+", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]] | 1 | 123 |
n, k = map(int, input().split())
a = set()
for _ in range(k):
d = int(input())
a += [int(m) for m in input().split()]
print(n - len(a))
| n, k = map(int, input().split())
a = []
for _ in range(k):
d = int(input())
a += [int(m) for m in input().split()]
print(n - len(set(a)))
| [["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["+", 0, 656, 0, 1, 0, 662, 12, 634, 0, 70], ["+", 0, 656, 0, 1, 0, 662, 12, 634, 0, 73], ["+", 0, 657, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12... | 5 | 64 |
N, K = map(int, input().split())
L = [list(map(int, input().split())) for _ in range(N+1)]
indexs = []
for i in range(len(L)):
if i%2 != 0:
indexs.append(L[i])
uniq_list = []
for li in indexs:
for e in li:
if e not in uniq_list:
uniq_list.append(e)
print(N - len(uniq_list)) | N, K = map(int, input().split())
L = [list(map(int, input().split())) for _ in range(K*2)]
indexs = []
for i in range(len(L)):
if i%2 != 0:
indexs.append(L[i])
uniq_list = []
for li in indexs:
for e in li:
if e not in uniq_list:
uniq_list.append(e)
print(N - len(uniq_list))
| [["-", 0, 659, 12, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 17, 48], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 110 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int N, K;
cin >> N >> K;
vector<bool> n(N, false);
for (int i = 0; i < K; ++i) {
int number;
cin >> number;
for (int l = 0; l < number; ++l) {
int buf;
cin >> buf;
n[buf - 1] = true;
}
}
int a... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int N, K;
cin >> N >> K;
vector<bool> n(N, false);
for (int i = 0; i < K; ++i) {
int number;
cin >> number;
for (int l = 0; l < number; ++l) {
int buf;
cin >> buf;
n[buf - 1] = true;
}
}
int a... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 135 |
#! /usr/bin/env python3
from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations,... | #! /usr/bin/env python3
from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations,... | [["+", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 22]] | 5 | 150 |
n,k = map(int,input().split())
master = []
count = 0
for num in range(k):
d = input()
sunuke = list(map(int,input().split()))
master+=sunuke
print(3-len(set(master))) | n,k = map(int,input().split())
master = []
count = 0
for num in range(k):
d = input()
sunuke = list(map(int,input().split()))
master+=sunuke
print(n-len(set(master))) | [["-", 0, 1, 0, 652, 3, 4, 0, 657, 31, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22]] | 5 | 68 |
N,K=map(int,input().split())
hoge={}
for j in range(K):
input()
[hoge.update({int(j):1}) for j in input().split()]
print(sum([not j in hoge for j in range(N)]))
| N,K=map(int,input().split())
hoge={}
for j in range(K):
input()
[hoge.update({int(j)-1:1}) for j in input().split()]
print(sum([not j in hoge for j in range(N)]))
| [["+", 3, 4, 0, 680, 0, 569, 448, 657, 17, 33], ["+", 3, 4, 0, 680, 0, 569, 448, 657, 12, 612]] | 5 | 75 |
#!usr/bin/env python3
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return [list(x) f... | #!usr/bin/env python3
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return [list(x) f... | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 293 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define INF 2 << 29
#define MOD 1000000007
#define Yes(f) puts((f) ? "Yes" : "No")
#define YES(f) puts((f) ? "YES" : "NO")
int gcd(int a, int b) {
if (b != 0)
return gcd(b, a % b);
return a;
}
int... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define INF 2 << 29
#define MOD 1000000007
#define Yes(f) puts((f) ? "Yes" : "No")
#define YES(f) puts((f) ? "YES" : "NO")
int gcd(int a, int b) {
if (b != 0)
return gcd(b, a % b);
return a;
}
int... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22]] | 1 | 182 |
line1 = input().split()
n = int(line1[0])
k = int(line1[1])
list1 = []
for i in range(k):
d = input()
lst = input().split()
list1 += lst
set1 = set(list1)
print(set1)
nothing = set(str(i+1) for i in range(n)) - set1
print(len(nothing)) | line1 = input().split()
n = int(line1[0])
k = int(line1[1])
list1 = []
for i in range(k):
d = input()
lst = input().split()
list1 += lst
set1 = set(list1)
nothing = set(str(i+1) for i in range(n)) - set1
print(len(nothing)) | [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 93 |
n, k = gets.split.map(&:to_i)
ary = []
(k*2).times do
ary << gets.split.map(&:to_i)
end
ans = Array.new(3, 0)
ary.each_with_index do |k, i|
if i.odd?
k.each do |l|
ans[l-1]+=1
end
end
end
count = 0
ans.each do |m|
count+=1 if m==0
end
puts count
| n, k = gets.split.map(&:to_i)
ary = []
(k*2).times do
ary << gets.split.map(&:to_i)
end
ans = Array.new(n, 0)
ary.each_with_index do |k, i|
if i.odd?
k.each do |l|
ans[l-1]+=1
end
end
end
count = 0
ans.each do |m|
count+=1 if m==0
end
puts count
| [["-", 0, 493, 0, 662, 12, 652, 3, 4, 0, 612], ["+", 0, 493, 0, 662, 12, 652, 3, 4, 0, 22]] | 4 | 98 |
#include <bits/stdc++.h>
using namespace std;
void solve() {
int n, k, d, r;
cin >> n >> k;
int A[n + 1] = {0};
for (int i = 0; i < k; i++) {
cin >> d;
for (int i = 0; i < d; i++) {
cin >> r;
A[r]++;
}
}
int c = 0;
for (int i = 0; i < n; i++) {
if (A[i] == 0)
c++;
}
c... | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n, k, d, r;
cin >> n >> k;
int A[n + 1] = {0};
for (int i = 0; i < k; i++) {
cin >> d;
for (int i = 0; i < d; i++) {
cin >> r;
A[r]++;
}
}
int c = 0;
for (int i = 1; i <= n; i++) {
if (A[i] == 0)
c++;
}
... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 8, 9, 0, 1, 0, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 1, 0, 16, 12, 16, 12, 13]] | 1 | 158 |
N,K=map(int,input().split())
kashi_num = [str(i+1) for i in range(N)]
for _ in range(K):
d = input()
for a in input().split():
if a in kashi_num:
kashi_num.remove(a)
if len(kashi_num)==0:
break
print(' '.join(kashi_num)) | N,K=map(int,input().split())
kashi_num = [str(i+1) for i in range(N)]
for _ in range(K):
d = input()
for a in input().split():
if a in kashi_num:
kashi_num.remove(a)
if len(kashi_num)==0:
break
print(len(kashi_num)) | [["-", 3, 4, 0, 652, 63, 319, 500, 557, 0, 654], ["-", 3, 4, 0, 652, 63, 319, 500, 557, 0, 6], ["-", 3, 4, 0, 652, 63, 319, 500, 557, 0, 655], ["-", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["-", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22]] | 5 | 88 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, ans = 0;
bool k[1005];
for (int i = 0; i < 1005; i++)
k[i] = false;
cin >> a >> b;
for (int i = 0; i < b; i++) {
int u;
cin >> u;
for (int j = 0; j < u; j++) {
int f;
cin >> f;
k[f] = true;
}
}
for (... | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, ans = 0;
bool k[1005];
for (int i = 0; i < 1005; i++)
k[i] = false;
cin >> a >> b;
for (int i = 0; i < b; i++) {
int u;
cin >> u;
for (int j = 0; j < u; j++) {
int f;
cin >> f;
k[f - 1] = true;
}
}
f... | [["+", 0, 11, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 11, 31, 69, 341, 342, 0, 16, 12, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 33], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]] | 1 | 144 |
n,k=map(int,input().split())
x=[c for c in range(1,n+1)]
for i in range(1,k+1):
d=int(input())
s=input().split()
for b in range(d):
if int(s[b]) in x:
x.remove(int(s_i[b]))
print(len(x))
| n,k=map(int,input().split())
x=[c for c in range(1,n+1)]
for i in range(1,k+1):
d=int(input())
s=input().split()
for b in range(d):
if int(s[b]) in x:
x.remove(int(s[b]))
print(len(x)) | [["-", 3, 4, 0, 652, 3, 4, 0, 206, 51, 22], ["+", 3, 4, 0, 652, 3, 4, 0, 206, 51, 22]] | 5 | 99 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<int> vec(n, 1);
for (int i = 0; i < k; i++) {
int d;
cin >> d;
for (int j = 0; j < d; j++) {
int a;
cin >> a;
vec.at(a) = 0;
}
}
int ans = 0;
for (int i = 0; i < n; i++) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<int> vec(n, 1);
for (int i = 0; i < k; i++) {
int d;
cin >> d;
for (int j = 0; j < d; j++) {
int a;
cin >> a;
vec.at(a - 1) = 0;
}
}
int ans = 0;
for (int i = 0; i < n; i++) {
... | [["+", 0, 11, 31, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 31, 2, 3, 4, 0, 16, 12, 13]] | 1 | 125 |
n,k = map(int,input().split())
count = []
for i in range(1,n+1):
count.append(i)
for i in range(k):
d = int(input())
A = list(map(int,input().split()))
ans = set(count)-set(A)
print(len(ans)) | N,K = map(int,input().split())
count = []
for i in range(1,N+1):
count.append(i)
for i in range(K):
d = int(input())
A = list(map(int,input().split()))
count = set(count) - set(A)
print(len(count)) | [["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22], ["+", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 7, ... | 5 | 89 |
nk = input().split()
n = int(nk[0])
k = int(nk[1])
s = [input() for i in range(k*2)]
o = []
for j in range(len(s)):
if j % 2 == 0:
pass
else:
o[len(o):len(o)] = s[j]
l =list(set(o))
ans = n - len(l)
print(ans) | nk = input().split()
n = int(nk[0])
k = int(nk[1])
s = [input().split() for i in range(k*2)]
o = []
for j in range(len(s)):
if j % 2 == 0:
pass
else:
o[len(o):len(o)] = s[j]
l =list(set(o))
ans = n - len(l)
print(ans) | [["+", 0, 662, 12, 658, 8, 652, 63, 319, 0, 131], ["+", 0, 662, 12, 658, 8, 652, 63, 319, 319, 22], ["+", 0, 662, 12, 658, 8, 652, 3, 4, 0, 24], ["+", 0, 662, 12, 658, 8, 652, 3, 4, 0, 25]] | 5 | 106 |
N,K = map(int,input().split())
D = {}
for i in range(N):
D[i+1] = 0
for i in range(K):
d = input()
A = list(map(int,input().split()))
for a in A:
d[a] += 1
ans = 0
for i in range(N):
if D[i+1] == 0:
ans += 1
print(ans) | N,K = map(int,input().split())
D = {}
for i in range(N):
D[i+1] = 0
for i in range(K):
d = input()
A = list(map(int,input().split()))
for a in A:
D[a] += 1
ans = 0
for i in range(N):
if D[i+1] == 0:
ans += 1
print(ans) | [["-", 8, 196, 0, 1, 0, 677, 31, 206, 51, 22], ["+", 8, 196, 0, 1, 0, 677, 31, 206, 51, 22]] | 5 | 105 |
#include <algorithm>
#include <cmath>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
typedef long long int64;
typedef vector<int> vec;
typedef vector<int64> vec64;
#define db(x) cout << "> " << #x << ": " << x... | #include <algorithm>
#include <cmath>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
typedef long long int64;
typedef vector<int> vec;
typedef vector<int64> vec64;
#define db(x) cout << "> " << #x << ": " << x... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]] | 1 | 207 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.