Search is not available for this dataset
name
stringlengths
2
112
description
stringlengths
29
13k
source
int64
1
7
difficulty
int64
0
25
solution
stringlengths
7
983k
language
stringclasses
4 values
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
S="012 345 678 036 147 258 048 246 " A=sum([input().split()for i in range(3)],[]) for b in [input()for i in range(int(input()))]: if b in A: S=S.replace(str(A.index(b)),"") print("YNeos"[S.find(" ")<0::2])
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
A = sum([list(map(int,input().split()))for _ in range(3)],[]) N = int(input()) b = [int(input()) for _ in range(N)] f=sum(1<<i for i in range(9)if A[i]in b) print('Yes'if[v for v in[7,56,73,84,146,273,292,448]if f&v==v]else'No')
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
a = [int(j) for i in range(3) for j in input().split(' ')] n = int(input()) nn = [int(input()) for i in range(n)] cnt = 0 for ni in nn: if ni in a: cnt += 1 a[a.index(ni)] = 0 judge = "No" for i in range(3): if sum(a[i::3])==0 or sum(a[i*3:i*3+3])==0: judge = "Yes" if sum(a[::4])==0 or (a[2]+a[4]...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import sys A=[] for a in range(3): l=[int(i) for i in input().split()] A.extend(l) f=[0]*9 for i in range(int(input())): b=int(input()) if b in A: f[A.index(b)]=1 #print(f) p=[[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]] for i in p: if all(f[x]==1 for x in i): ...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
a = list(map(int,input().split())) b = list(map(int,input().split())) c = list(map(int,input().split())) d = [a[0],b[0],c[0]] e = [a[1],b[1],c[1]] f = [a[2],b[2],c[2]] g = [a[0],b[1],c[2]] h = [a[2],b[1],c[0]] n = int(input()) bs = [] for _ in range(n): bs.append(int(input())) for l in [a,b,c,d,e,f,g,h]: ...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#!/usr/bin/env python from collections import deque, defaultdict import itertools as ite import sys import math from decimal import * sys.setrecursionlimit(1000000) INF = 10 ** 18 MOD = 10 ** 9 + 7 A = [map(int, raw_input().split()) for i in range(3)] N = input() for i in range(N): b = input() for j in rang...
PYTHON
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
a = list(map(int,input().split())) b = list(map(int,input().split())) c = list(map(int,input().split())) n = int(input()) l = [] for i in range(n): li = int(input()) l.append(li) for x in [a,b,c,[a[0],b[0],c[0]],[a[1],b[1],c[1]],[a[2],b[2],c[2]],[a[0],b[1],c[2]],[a[2],b[1],c[0]]]: flag = True for xi in x: i...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include<bits/stdc++.h> using namespace std; #define ll long long map<int,int>mp; int main() { ll a1,a2,a3,b1,b2,b3,c1,c2,c3,n,x; cin>>a1>>a2>>a3>>b1>>b2>>b3>>c1>>c2>>c3; cin>>n; while(n--) { cin>>x; mp[x]=1; } if((mp[a1]==1&&mp[a2]==1&&mp[a3]==1)||(mp[a1]==1&&mp[b1]==1&&mp[...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
a = [0] * 3 for i in range(3): a[i] = list(map(int, input().split())) n = int(input()) b = set() for _ in range(n): b.add(int(input())) if ( set(a[0]) <= b or set(a[1]) <= b or set(a[2]) <= b or set(x[0] for x in a) <= b or set(x[1] for x in a) <= b or set(x[2] for x in a) <= b or {...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include<bits/stdc++.h> using namespace std; int a[5][5]; bool f[5][5]; int main() { int n,i,j,x; for(i=1;i<4;i++) for(j=1;j<4;j++) cin>>a[i][j]; cin>>n; while(n--) { cin>>x; for(i=1;i<4;i++) for(j=1;j<4;j++) if(a[i][j]==x) f[i][j]=true; } if(f[1][1]&&f[1][2]&&f[1][3]||f[2][1]&&f[2][2]&&f[2]...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
A=open(0).read().split() print('YNeos'[all(t-set(map(A.index,A[10:])) for t in({0,1,2},{3,4,5},{6,7,8},{0,3,6},{1,4,7},{2,5,8},{0,4,8},{2,4,6}))::2])
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include<bits/stdc++.h> using namespace std; int a[3][3],b[105]; bool f[3][3]; int main(){ int n; for(int i=0;i<3;i++) for(int j=0;j<3;j++) cin>>a[i][j]; cin>>n; while(n--){ int t; cin>>t; for(int j=0;j<3;j++) for(int k=0;k<3;k++){ if(a[j][k]==t) f[j][k]=true; } } if(f[0][0]&&f[1...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines lst = list(map(int, read().split())) arr=lst[:9] tf = [False] * 10 for i in lst[10:]: if i in arr: tf[arr.index(i)] = True t=[[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]] for i in t: a = True f...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[][] A = new int[3][3]; for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { A[i][j] = sc.nextInt(); } } int N = sc.nextInt(); int[] B = new int[N]; for(int i = 0...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.*; class Main{ public static void main(String[] args){ Scanner scn = new Scanner(System.in); int[] bingo = new int[9]; for(int i = 0;i<9;i++){ bingo[i] = scn.nextInt(); } int n = scn.nextInt(); for(int j = 0; j < n;j++){ int x = scn.nextInt(); for...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> using namespace std; int main() { int i,j,n,b; int a[3][3]; int r[3]={0,0,0}; int c[3]={0,0,0}; int d1=0,d2=0; int f=0; for(i=0;i<3;i++) { for(j=0;j<3;j++) cin>>a[i][j]; } cin>>n; while(n--) { cin>>b; if(f) continue; for(i=0;i<3;i++) { for(j=0;j<3;j++) ...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
a=open(0).read().split();print('YNeos'[all(t-set(map(a.index,a[10:]))for t in({0,3,6},{0,4,8},{1,4,7},{2,4,6},{2,5,8},{3,4,5},{6,7,8}))::2])
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.Scanner; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int a[][] = new int[3][3]; for(int i=0;i<a.length;i++){ for(int j=0;j<a[i].length;j++){ a[i][j]=sc.nextInt(); } } int h[] = {0,0,0}; int w[] = {0,0,0}; int nn[] = {0,0}; ...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
a=[0]*9 a[0],a[1],a[2]=map(int, input().split()) a[3],a[4],a[5]=map(int, input().split()) a[6],a[7],a[8]=map(int, input().split()) N=int(input()) B=[] for i in range(N): B.append(int(input())) S=[[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]] ans='No' for lis in S: n=0 if ans=="Yes": break...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> using namespace std; int main() { int a[3][3]={}; int c[3][3]={}; int counter=0; for(int i=0;i<3;i++){ for(int j=0;j<3;j++){ cin>>a[i][j];}} int N,b; cin>>N; for(int k=0;k<N;k++){ cin>>b; for(int i=0;i<3;i++){ for(int j=0;j<3;j++){ if(b==a[i][j]){ c[i][j]=1;}}}} for(int i=0;i<3;i++){ if(c[i][0...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main(){ vector<int> a(9); rep(i, 9) cin >> a.at(i); int n; cin >> n; vector<int> b(n); vector<bool> c(9, false); rep(i, n) { cin >> b.at(i); rep(j, 9) { if (a.at(j) == b.at(i)) c.at(j) = true; } } if ...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <iostream> using namespace std; int main(void){ int pos[110]={0}; int c[10]={0}; int n; for (int i=1; i<=9; i++){ int t; cin >> t; pos[t]=i; } cin >> n; for (int i=0; i<n; i++){ int t; cin >> t; c[pos[t]]=1; } cout << (((c[1]&&c[2]&&c[3])|| (c[4]&&c[5]&...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.Scanner; class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int[][] a=new int[3][3]; for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { a[i][j]=sc.nextInt(); } } int n=sc.nextInt(); int[] b=new int[n]; for(int k=0;k<n;k++){ b[k]...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static final MyScanner in = new MyScanner(); public static void main(String[] args) { int[] pos = new int[100+1]; for(int i=1; i<=9; i++) { pos[in.nextInt()] = i; } int N =...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner kbd = new Scanner(System.in); int[] i1 = new int[3]; for(int n=0;n<3;n++){ i1[n] = kbd.nextInt(); } int[] i2 = new int[3]; for(int n=0;n<3;n++){ i2[n] = kbd.nextInt(); } int[] i3 = new int[3]...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int[]bingo = new int[9]; for(int i = 0; i < 9; i++) { String[] temp = scanner.nextLine().split(" "); bingo[i] = Integer.parseInt(temp[0]); bingo[i + 1] = Integer.pars...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include<iostream> using namespace std; int main() { int A[9], marked; marked = 0; for (int i = 0; i < 9; i++) cin >> A[i]; int N, b; cin >> N; for (int j = 0; j < N; j++) { cin >> b; for (int i = 0; i < 9; i++) { if (A[i] == b) marked |= (1<<i); } } int bingos[] = {0b000000111, 0b00011...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> using namespace std; bool bingo(int a[]){ if(a[0]+a[1]+a[2]==0 || a[3]+a[4]+a[5]==0 || a[6]+a[7]+a[8]==0 || a[0]+a[3]+a[6]==0 || a[1]+a[4]+a[7]==0 || a[2]+a[5]+a[8]==0 || a[0]+a[4]+a[8]==0 || a[2]+a[4]+a[6]==0) return true; else return false; } int main(){ int a[9]; for(int i=...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
a1=list(map(int,input().split())) a2=list(map(int,input().split())) a3=list(map(int,input().split())) n=int(input()) a=a1+a2+a3 b=set([int(input()) for _ in range(n)]) c1=set(a[0::3]) c2=set(a[1::3]) c3=set(a[2::3]) c4=set([a1[0],a2[1],a3[2]]) c5=set([a1[2],a2[1],a3[0]]) c=[set(a1),set(a2),set(a3),c1,c2,c3,c4,c5] j = ...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[][] num = new int[3][3]; boolean[][] bingo = new boolean[3][3]; for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { num[i][j] = sc.nextInt(); } } int n = sc.nex...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import sys a=[] for i in range(3): a= a+[int(x) for x in input().split()] # print(a) n=int(input()) for i in range(n): b=int(input()) for j in range(9): if a[j] == b: a[j]=-1 # print(a) for i,k,j in [[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9],[1,5,9],[3,5,7]]: if a[i-1]==a[j-1...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { int[][] a = new int[3][3]; boolean[][] f = new boolean[3][3]; @SuppressWarnings("resource") Scanner scanner = new Scanner(System.in); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { a[i][j] = scanner....
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
a = list(map(int,input().split())) a.extend(list(map(int,input().split()))) a.extend(list(map(int,input().split()))) n = int(input()) ins = [] for i in range(n): b = int(input()) if b in a: ins.append(a.index(b)) okp = [(0,1,2), (3,4,5), (6,7,8) ,(0,3,6), (1,4,7), (2,5 ,8), (0,4,8), (2,4,6)] f = "No" ...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.*; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int a[][] = new int[3][3]; for(int i = 0; i < 3; ++i){ for(int j = 0; j < 3; ++j){ a[i][j] = sc.nextInt(); } } int n = sc.nextInt(); boolean tmpa[][] = new boolean[3][3]; for(...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0;i<n;i++) int a[3][3]; template<typename T> void fin(T a){ cout<<a<<endl; exit(0); } signed main(){ REP(i,3)REP(j,3)cin>>a[i][j]; int n;cin>>n; while(n--){ int s;cin>>s; REP(i,3)REP(j,3)if(a[i][j]==s)a[i][j]=0; } REP(i,3){ ...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] b = new int[9]; for (int i = 0; i < 9; i++) { b[i] = sc.nextInt(); } int n = sc.nextI...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { HashMap<Integer,Integer> bingo = new HashMap<>(); for(int i=0;i<9;i++) { bingo.put(sc.nextInt(),i); } int N=sc.nextInt(); boolean f[]=new boolean[9],an=false; Arrays.fill(f, fa...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
A1=list(map(int,input().split())) A2=list(map(int,input().split())) A3=list(map(int,input().split())) A=A1+A2+A3 N=int(input()) ans=[0]*9 a='No' for i in range(N): b=int(input()) if b in A: ans[A.index(b)]=1 cheack=[ans[0:3],ans[3:6],ans[6:9],ans[0::3],ans[1::3],ans[2::3],ans[0::4],ans[2:7:2]] for C in ...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
S="012 345 678 036 147 258 048 246 " A=sum([input().split()for i in range(4)],[]) for b in [input()for i in range(int(A[9]))]: if b in A: S=S.replace(str(A.index(b)),"") print("YNeos"[S.find(" ")<0::2])
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
a = [] for i in range(3): a.append(map(int,raw_input().split())) n = input() for j in range(n): b = input() for j in range(3): for k in range(3): if a[j][k] == b: a[j][k] = 0 diag1 = [a[0][0],a[1][1],a[2][2]] diag2 = [a[0][2],a[1][1],a[2][0]] res = 'No' if sum(diag1) ==0...
PYTHON
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for (int64_t i = (a); i < (b); i++) #define REP(i,n) rep(i,0,n) #define m(q,w,e) (f[(q)]&&f[(w)]&&f[(e)]) void solve() { int a[9]; REP(i,9)cin>>a[i]; bool f[9];REP(i,9)f[i]=0; int n;cin>>n; REP(i,n){ int x;cin>>x; RE...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include<iostream> using namespace std; int main(){ int A[3][3]; for(int i = 0;i < 3;++i) for(int j = 0;j < 3;++j) cin >> A[i][j]; int N, b; cin >> N; for(int i = 0;i < N;++i){ cin >> b; for(int i = 0;i < 3;++i) for(int j = 0;j < 3;++j) if(A[i][j] == b) A[i][j] = ...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include<bits/stdc++.h> using namespace std; int main(){ int b[3][3]; for(int i=0;i<3;i++){ for(int j=0;j<3;j++){ cin>>b[i][j]; } } int n; cin>>n; for(int i=0;i<n;i++){ int tgt; cin>>tgt; for(int j=0;j<3;j++){ for(int k=0;k<3;k++){ if(b[j][k]==tgt)b[j][k]=0; } } } bool flag=false; for(...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[][] a = new int[3][3]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { a[i][j] = sc.nextInt(); } } i...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
A = [] a = [1]*9 for i in range(3): A += input().split() n = int(input()) for i in range(n): b = input() if b in A: a[A.index(b)] = 0 for i in range(3): if a[3*i] + a[3*i+1] + a[3*i+2] == 0 or a[i] + a[i+3] + a[i+6] == 0: print('Yes') break else: if a[0] + a[4] + a[8] == 0 o...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] A = new int[9]; for (int i = 0; i < A.length; i++) { A[i] = sc.nextInt(); } in...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
A = [list(map(int, input().split())) for _ in range(3)] N = int(input()) B = [int(input()) for _ in range(N)] for i in range(3): if (A[i][0] in B and A[i][1] in B and A[i][2] in B) or (A[0][i] in B and A[1][i] in B and A[2][i] in B): print("Yes") exit() if (A[0][0] in B and A[1][1] in B and A[2][2] ...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) typedef long long ll; typedef vector<int> vec; int main(){ int A[3][3]; rep(i,3)rep(j,3)cin>>A[i][j]; int n; int b; cin>>n; rep(i,n){ cin>>b; rep(j,3)rep(k,3){ if(b==A[j][k])A[j][k]=0; } } ...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
A = [list(map(int, input().split())) for _ in range(3)] N = int(input()) B = [int(input()) for _ in range(N)] bingo = False for i in range(3): if (A[i][0] in B and A[i][1] in B and A[i][2] in B) or (A[0][i] in B and A[1][i] in B and A[2][i] in B): bingo = True if (A[0][0] in B and A[1][1] in B and A[2][2] i...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int[][] a = new int[3][3]; boolean[][] s = new boolean[3][3]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { a[i][j] = scanner.nextInt(); ...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
s = " 012 345 678 036 147 258 048 246 " a = [input().split() for i in range(3)] b = a[0] + a[1] + a[2] for i in [input()for i in range(int(input()))]: if i in b: s = s.replace(str(b.index(i)), "") print("Yes" if " " in s else "No")
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.Scanner; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int[][] a = new int[3][3]; for(int i = 0;i < 3;i++){ for(int x = 0;x < 3;x++){ a[i][x] = sc.nextInt(); } } boolean[][] flag = new boolean[3][3]; boolea...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
a11,a12,a13,a21,a22,a23,a31,a32,a33,n,*b=map(int, open(0).read().split()) b=set(b) if {a11,a12,a13}<=b or {a21,a22,a23}<=b or {a31,a32,a33}<=b or {a11,a21,a31}<=b or {a12,a22,a32}<=b or {a13,a23,a33}<=b or {a11,a22,a33}<=b or{a13,a22,a31}<=b: print('Yes') else: print('No')
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
# B - Bingo A = [] for _ in range(3): tmp = list(map(int,input().split())) A.extend(tmp) B = [0]*9 N = int(input()) for _ in range(N): tmp = int(input()) for i in range(9): if tmp==A[i]: B[i] = 1 ans = 'No' for i,j,k in [(0,1,2),(3,4,5),(6,7,8),(0,3,6),(1,4,7),(2,5,8),(0,4,8),(2,4,6)...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> using namespace std; int main() { int g[3][3]; bool b[3][3]; for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) cin >> g[i][j], b[i][j] = 0; int n; cin >> n; while (n--) { int t; cin >> t; for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) i...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> using namespace std; int main(){ int a[9]; for(int i=0; i<9; i++){ cin >> a[i]; } int n; cin >> n; int b[n]; bitset<9> u; for(int j=0; j<n; j++){ cin >> b[j]; for(int p=0; p<9; p++){ if(a[p]==b[j]){ u.set(p,1); } } } if (u[0] & u[4] & u[8] ...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
Bingo = [ list(map(int,input().split())) for i in range(3)] n = int(input()) num = [int(input()) for i in range(n)] Bingo.append([Bingo[0][0] , Bingo[1][1],Bingo[2][2] ]) Bingo.append([Bingo[0][2] , Bingo[1][1],Bingo[2][0] ]) for k in range(3): Bingo.append([Bingo[0][k] , Bingo[1][k],Bingo[2][k] ]) k=0 re = 'No' for ...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] card = new int[9]; for(int i = 0; i < 9; i++) { card[i] = sc.nextInt(); } int n = sc.nextInt(); for(int i = 0; i < n; i++) { int b = sc.nextInt(); for(int j = 0; j < 9...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
*A1, = map(int, input().split()) *A2, = map(int, input().split()) *A3, = map(int, input().split()) A = A1 + A2 + A3 N = int(input()) a = [int(input()) for _ in range(N)] chk = [A[:3], A[3:6], A[6:9], A[::3], A[1::3], A[2::3], A[::4], A[2:7:2]] for c in chk: ans = 0 for cc in c: if cc in a: a...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
//package abc157.B; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] a = new int[9]; for (int i = 0; i < 9; i++) { a[i] = sc.nextInt(); } int n = sc.nextInt(); for (int i = 0; i < n; i++) { int b = sc.nextIn...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> using namespace std; int main(){ int A[9]; int N,num; bool count =false; for(int i=0;i<9;i++){ cin>>A[i]; } cin>>N; for(int i=0;i<N;i++){ cin>>num; for(int j=0;j<9;j++){ if(A[j]==num){ A[j]=0; } } } if(A[0]==0&&A[4]==0&&A[8]==0){ count=true; } e...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0;i<n;i++) template<typename T> void fin(T a){ cout<<a<<endl; exit(0); } int a[3][3]; int main(){ REP(i,3)REP(j,3)cin>>a[i][j]; int n;cin>>n; while(n--){ int s;cin>>s; REP(i,3)REP(j,3)if(a[i][j]==s)a[i][j]=0; } REP(i,3){ ...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include<bits/stdc++.h> int main(){ std::vector<int>a(9); for(int i=0;i<9;i++)std::cin>>a.at(i); std::vector<int>ckd(9); int n;std::cin>>n; for(int i=0;i<n;i++){ int x;std::cin>>x; for(int j=0;j<9;j++){ ckd.at(j)|=x==a.at(j); } } bool ok=false; for(int...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cout.tie(0); cin.tie(NULL); int a[3][3]; for(int i=0;i<3;i++) for(int j=0;j<3;j++) cin>>a[i][j]; int n; cin>>n; while(n--) { int x; cin>>x; for(int i=0;i<3;i++) for(int j=0;j<3;j++) { if(a[i][j]==x) a[i][j]=-1; } } int...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int (i) = 0; (i) < (n); ++(i)) using P = pair<int, int>; int n; map<int, P>mp; bool t[3][3]; int main() { rep(i, 3) { rep(j, 3) { int a; cin >> a; mp[a] = P(i, j); } } cin >> n; rep(i, n) { int b; cin >> b; if (mp.find(b) != mp....
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int[][] a=new int[3][3]; for(int c=0;c<3;c++){ a[c][0]=sc.nextInt(); a[c][1]=sc.nextInt(); a[c][2]=sc.nextInt(); } int n=sc.nextInt(); int[] b=new ...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> using namespace std; typedef long long ll; int n; int a[4][4]; bool m[4][4]; int main(){ for (int i=1;i<=3;i++){ for (int j=1;j<=3;j++){ cin >> a[i][j]; } } cin >> n; for (int i=1,b;i<=n;i++){ cin >> b; for (int j=1;j<=3;j++){ for (int k=1;k<=3;k++){ if (a[j][k]==b){ ...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int[] bingo = new int[9]; for(int i = 0; i < 9; i++){ bingo[i] = sc.nextInt(); } while(sc.hasNext()){ int next = sc.nextInt(); ...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <iostream> #include <algorithm> int main() { int a[9]; for (auto &e : a) std::cin >> e; int n; std::cin >> n; int b; for (int i = 0; i < n; i++) { std::cin >> b; auto p = std::find(a, a + 9, b); if (p != a + 9) *p = 0; } for (int i = 0; i < 9; i += 3) { if ((a[i] | a[i + 1] | a[i + 2]) == 0)...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
A=[input().split() for _ in range(3)] N=int(input()) B=[input() for _ in range(N)] for i in range(3): for j in range(3): if A[i][j] in B: A[i][j]=0 if A[0][0]==A[1][1]==A[2][2] or A[0][2]==A[1][1]==A[2][0]: print("Yes") exit() for n in range(3): if A[0][n]==A[1][n]==A[2][n] or A[n][0]==A[n][1]==A[n...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
bingo=[list(map(int,input().split())) for _ in range(3)] N=int(input()) D=[[0]*3 for _ in range(3)] for _ in range(N): b=int(input()) for i in range(3): for j in range(3): if b==bingo[i][j]: D[i][j]=1 ans=set() for d in D: ans.add(sum(d)) for d in zip(*D): ans.add(su...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
x=list(map(int,input().split())) y=list(map(int,input().split())) z=list(map(int,input().split())) A=[x,y,z] X=[A[0][0],A[1][0],A[2][0]] Y=[A[0][1],A[1][1],A[2][1]] Z=[A[0][2],A[1][2],A[2][2]] P=[A[0][0],A[1][1],A[2][2]] Q=[A[0][2],A[1][1],A[2][0]] B=[] for i in range(int(input())): B.append(int(input())) C=[x,y,z,...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
A = [[int(x) for x in input().split()] for i in range(3)] n = int(input()) B = set(int(input()) for i in range(n)) res = False for row in A: if all(x in B for x in row): res = True for j in range(3): if all(A[i][j] in B for i in range(3)): res = True if all(A[i][i] in B for i in range(3)): r...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int A[][] = new int[3][3]; for(int i=0;i<3;i++){ for(int j=0;j<3;j++){ A[i][j]=sc.nextInt(); } } int N = sc.nextInt(); int b[] = new int[N]; for(int i=0;i...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <iostream> using namespace std; int main(){ int bingo[3][3]; for(int i = 0; i < 3; i++){ for(int j = 0; j < 3; j++){ cin >> bingo[i][j]; } } int n; cin >> n; int num; int flag[8]={}; for(int k = 0; k < n; k++){ cin >> num; for(int i = 0; i < 3; i++){ for(int j = 0; j ...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
A=[list(map(int,input().split())) for _ in range(3)] N=int(input()) b=[int(input()) for _ in range(N)] flag=0 for i in range(3): if (A[0][i] in b)and(A[1][i] in b)and(A[2][i] in b): flag=1 elif (A[i][0] in b)and(A[i][1] in b)and(A[i][2] in b): flag=1 if (A[0][0] in b)and(A[1][1] in b)and(A[2][2] in b): fl...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include<bits/stdc++.h> using namespace std; int main() { vector<vector<int>> A(3,vector<int>(3));vector<vector<bool>> check(3,vector<bool>(3,false)); for(int i=0;i<3;i++)for(int j=0;j<3;j++)scanf("%d ",&A[i][j]); int N;scanf("%d",&N);; vector<int> B(N); for(int i=0;i<N;i++)scanf("%d",&B[i]); for(int i=0;i<3;i++)for(i...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> using namespace std; int main() { vector<int> a(10); for(int i=1;i<=9;i++){ cin >>a[i]; } int N; cin >>N; vector<int> b(N+1); for(int i=1;i<=N;i++){ cin >>b[i]; for(int k=1;k<=9;k++){ if(b[i]==a[k]){ a[k]=0; } } } if(a[1]+a[2]+a[3]==0||a[4]+a[5]+a[6]==0||a[7]+a[8]+a...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> #define ll long long using namespace std; int n,a[10]; map<int,int>k; bool b[10],ans=false; int main() { for(int i=0;i<9;i++){ cin>>a[i]; k[a[i]]=i; b[i]=false; } cin>>n; for(int i=0;i<n;i++){ int c; cin>>c; if(k.count(c))b[k[c]]=true; } ans=((b[0]&&b[4]&&b[8])||(b[6]&&b[...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.ArrayList; import java.util.Scanner; public class Main { static String anser ="No"; public static void main(String[] args) { Scanner scan = new Scanner(System.in); int[] card = new int[9]; for (int i = 0; i < 9; i++) { card[i] = scan.nextInt(); } int n = scan.nextInt(); int[] num...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> using namespace std; int main(){ int a[3][3]; bool b[3][3]; memset(b,false,sizeof(b)); for(int i=0;i<3;i++) for(int j=0;j<3;j++) cin>>a[i][j]; int n; cin>>n; for(int i=1;i<=n;i++){ int k; cin>>k; for(int q=0;q<3;q++) for(int x=0;x<3;x++) if(a[q][x]==k) b[q][x]=true; } ...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
a=[list(map(int,input().split())) for i in range(3)] n=int(input()) b=[int(input()) for i in range(n)] flag =False for i in range(3): if all(a[i][j] in b for j in range(3)): flag=True if all(a[j][i] in b for j in range(3)): flag=True if all(a[j][j] in b for j in range(3)) or all(a[i][2-i] in b for i in rang...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[][] a = new int[3][3]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { a[i][j] = sc.nextInt(); } } int n = sc.nextInt(); int[] b = new int[n]; for (in...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> using namespace std; int main (){ int i,j,k; int s[3][3]; for(i=0;i<3;i++){ for(j=0;j<3;j++){ cin>>s[i][j]; } } int n,b; cin>>n; for(k=0;k<n;k++){ cin>>b; for(i=0;i<3;i++){ for(j=0;j<3;j++){ if(s[i][j]==b) s[i][j]=0; } } } ...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int matrix[][] = new int[3][3]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { matrix[i][j] = sc.nextInt(); } } int n = sc.nextInt(); int leftDiag = 0, rightD...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> using namespace std; void Y(){ cout<<"Yes"<<endl; exit(0); } int main(){ int a[9],b[9]; for (int i = 0; i < 9; i++) cin >> a[i]; int n,x; cin>>n; for(int i = 0; i < n; i++){ cin>>x; for (int i = 0; i < 9; i++){ if(x==a[i]) b[i]=1; } } if(b[0]*b[1]*b[2]==1) Y()...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
l = [] for _ in range(3): l += list(map(int, input().split())) n = int(input()) for _ in range(n): b = int(input()) if b in l: l[l.index(b)] = 0 for i in range(3): if sum(l[0+3*i:3+3*i]) == 0: print("Yes") exit() if sum(l[i:9:3]) == 0: print("Yes") exit() if (l[0]+l[4]+l[8]) == 0: ...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.*; import static java.lang.Math.*; import java.math.BigInteger; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 入力 int[][] bingo = new int[3][3]; for(int i = 0; i < 3; i++){ for(int j = 0; j < 3; j++){ bingo[i][j] = sc.nex...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
p,r=input,range A=sum([list(map(int,p().split()))for _ in r(3)],[]) N=int(p()) b=[int(p())for _ in r(N)] print('Yes'if[v for v in[7,56,73,84,146,273,292,448]if sum(1<<i for i in r(9)if A[i]in b)&v==v]else'No')
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int[][] bingo = new int[3][3]; String[] line; for(int i=0; i<3; i++){ line = br.readLine().split(" "); for ...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#coding:utf-8 #!/usr/bin/python A=[raw_input().split() for i in range(3)] b=[] N=int(raw_input()) for i in range(N): b.append(raw_input()) C=[[0 for i in range(3)] for j in range(3)] for i in range(N): for j in range(3): for k in range(3): if(A[j][k]==b[i]): C[j][k]=1 #pri...
PYTHON
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include<bits/stdc++.h> using namespace std; int a[3][3],b[3][3]={0}; int main() { int i,j,c; for(i=0;i<3;i++)for(j=0;j<3;j++)cin>>a[i][j]; int n;cin>>n; while(n--) { scanf("%d",&c); for(i=0;i<3;i++) for(j=0;j<3;j++) if(a[i][j]==c) {b[i][j]=1;goto loop;} loop: ; } for(i=0;i<3;i++)if(b[i][0]&&b[...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
A=[] B=[False]*9 for i in range(3): A+=[int(i) for i in input().split()] n=int(input()) for _ in range(n): b=int(input()) for i in range(9): if b==A[i]: B[i]=True C=[[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9],[1,5,9],[3,5,7]] Chk=False for a,b,c in C: if B[a-1] and B[b-1] and B[c-1]: Chk=True...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.Scanner; import java.io.*; class Main{ public static void main(String[] args) { int[] A={0,0,0,0,0,0,0,0,0}; int[] A2={0,0,0,0,0,0,0,0,0}; Scanner scan = new Scanner(System.in); for(int i=0;i<9;i++){ A[i]=scan.nextInt(); } int N; int b; N=scan.nextInt(); for(int i=0;i<N;i++){ ...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
A = [list(map(int, input().split())) for _ in range(3)] N = int(input()) B = [int(input()) for _ in range(N)] A = sum(A,[]) for b in B: if b in A: A[A.index(b)] = -1 if A[0]==A[1]==A[2] or A[3]==A[4]==A[5] or A[6]==A[7]==A[8] or A[0]==A[3]==A[6] or A[1]==A[4]==A[7] or A[2]==A[5]==A[8] or A[0]==A[4]==A[8] ...
PYTHON3
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int[][] a = new int[3][3]; int[][] c = new int[3][3]; for (int i=0; i<3; i++ ) { for (int j=0; j<3; j++ ) { a[i][j] = sc.nextInt(); } } int n = sc.nextInt(); for (int k=0; k<n; k...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include<bits/stdc++.h> using namespace std; int n; int a[11][11]; int main() { for(int i=0;i<3;i++) for(int j=0;j<3;j++) { scanf("%d", &a[i][j]); } scanf("%d", &n); for(int t=0;t<n;t++) { int x; scanf("%d", &x); for(int i=0;i<3;i++) for(int j=0;j<3;j++) if(a[i][j]==x) a[i][j] = 0; } bool c...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
import java.util.*; //import java.util.stream.Collectors; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); Integer[] a = new Integer[9]; Arrays.setAll(a, i -> Integer.parseInt(sc.next())); List<Integer> list = new ArrayList<>(Arrays.asList(a)); int n = Integ...
JAVA
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include<cstdio> int a[10][10],f[10][10],b[110],n; int main() { for (int i=1;i<=3;++i) for (int j=1;j<=3;++j) scanf("%d",&a[i][j]); scanf("%d",&n); for (int k=1;k<=n;++k) { scanf("%d",&b[k]); for (int i=1;i<=3;++i) for (int j=1;j<=3;++j) if (a[i][j]==b[k]) f[i][j]=1; } for (int i=1;i<=3;++i) { if (f[i][1]+f...
CPP
p02760 AtCoder Beginner Contest 157 - Bingo
We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}. The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet. Determine whether we will have a bi...
6
0
#include <bits/stdc++.h> #define rep(i,n) for (int i=0;i<(n);++i) using namespace std; int main(){ vector<int> a(9); vector<int> b(9); rep(i,9) cin >> a[i]; int n; cin >> n; rep(i,n){ int tmp; cin >> tmp; rep(j,9){ if (a[j]==tmp) b[j]=1; } } int ans = 0; rep(i,3){ if (b[0+i]...
CPP