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
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; typedef long long ll; typedef pair <int,int> P; bool f[3][3]; int main(){ int a[3][3]; rep(i,3) rep(j,3) cin>>a[i][j]; int n; cin>>n; rep(i,n){ int b; cin>>b; rep(i,3) rep(j,3){ if(b==a[i][j]) f[i][j]=tru...
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
A11, A12, A13 = map(int, input().split()) A21, A22, A23 = map(int, input().split()) A31, A32, A33 = map(int, input().split()) N = int(input()) b = [int(input()) for i in range(N)] Bingo = [[A11, A12, A13], [A21, A22, A23], [A31, A32, A33], \ [A11, A21, A31], [A12, A22, A32], [A13, A23, A33], \ [A11,...
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())) for _ in range(3)] N=int(input()) bn=[int(input()) for _ in range(N)] ans=False for ver in zip(*A): if all(item in bn for item in ver): ans=True for wide in A: if all(item in bn for item in wide): ans=True if all(A[i][i] in bn for i in range(3)): ans=True if...
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[9]; int n,b; for (auto& x : a) cin >> x; cin >> n; for (int i = 0; i < n; i++){ cin >> b; for (auto& x : a) { if (x == b) x = 0; } } 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] +...
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); try { boolean[] hit = new boolean[9]; 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; ...
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 { 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; boolean[][] is = new boolean[3][3]; for (int k=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 = [] for i in range(3): a.extend(list(map(int,input().split()))) n = int(input()) b = [] cnt=[] pattern=[[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 range(n): b.append(int(input())) for j , x in enumerate(a): if x == b[i]: cnt.append(j) for q,w,e in pat...
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())) for _ in range(3)] n = int(input()) B = [int(input()) for _ in range(n)] li = [] for i in A: li.append(i) for i in range(3): li.append([A[0][i], A[1][i], A[2][i]]) li.append([A[0][0], A[1][1], A[2][2]]) li.append([A[0][2], A[1][1], A[2][0]]) for i, j, k in li: if i in B and ...
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 <stdio.h> int main() { int x; int a[9]; for(int i=0;i<9;i++) { scanf("%d",&a[i]); } int n; scanf("%d",&n); for(int i=0;i<n;i++) { scanf("%d",&x); for(int t=0;t<9;t++) { if(a[t]==x) { a[t]=-1; } } } if((a[0]==a[1]&&a[2]==a[1])||(a[3]==a[4]&&a[4]==a[5])||(a[6]==a[7]&&a[7]==a[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
import java.util.*; import java.math.*; 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 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 = [] for i in range(3): A.extend(input().split()) n = int(input()) for i in range(n): com = input() if com in A: A[A.index(com)] = '0' 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 ...
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 n; int a[9], b[11]; for(int i=0;i<9;i++)cin >> a[i]; cin >> n; for(int i=0;i<n;i++){ cin >> b[i]; for(int j=0;j<9;j++){ if(b[i]==a[j])a[j]=0; } } int flag=0; if(a[0]+a[1]+a[2]==0)flag=1; if(a[3]+a[4]+a[5]==0)flag=1; 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
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[][] a = new int[3][3]; int[] b = new int[10]; boolean[][] appear = new boolean[3][3]; String ans = "No"; for(int i = 0; i < 3; i++){ for(int j = 0; j < 3; j++){ a[i][j] = 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.ArrayList; import java.util.List; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // int M = Integer.parseInt(sc.next()); // String S = sc.next(); List<Integer> bingoList = new ArrayList(); for(int i=0; i<3; i++) { 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
import java.util.*; class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int [] num = new int[9]; int[][] bingo = {{0,1,2}, {3,4,5}, {6,7,8}, {0,3,6}, {1,4,7}, {2,5,8}, {0,4,8}, {2,4,6}}; boolean ok = false; for (int i=0; i<9; i++) { num[i] = 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
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[] g=new int[n]; for(int i=0;i<n;i++) { g...
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()) for i in range(n): x = int(input()) for j in range(3): if x in a[j]: a[j][a[j].index(x)]=0 for i in range(3): if a[i][0]==a[i][1]==a[i][2]==0 or a[0][i]==a[1][i]==a[2][i]==0 or a[0][0]==a[1][1]==a[2][2]==0 or a[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
from collections import OrderedDict a = OrderedDict() for i in range(3): for j in input().split(): a[j] = 0 n = int(input()) for i in range(n): inp = input() if inp in a.keys(): a[inp] = 1 anss = list(a.values()) lines = [(0,1,2), (3,4,5), (6,7,8), (0,3,6), (1,4,7), (2,5,8), (0,4,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
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) const string YES = "Yes"; const string NO = "No"; int main(){ vector<int> A(9); rep(i, 9) cin >> A[i]; int N; cin >> N; vector<bool> open(N, false); rep(i, N) { int b; cin >> b; rep(j, 9) if (A[j] == b) o...
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] = Integer.parseInt(sc.next()); } } int n = Integer.parseInt(sc.next()); ...
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)] for i in range(int(input())): b=int(input()) for j in range(3): for k in range(3): if a[j][k]==b:a[j][k]=0 ans="No" for i in range(3): if a[i][0]==a[i][1]==a[i][2]==0:ans="Yes" if a[0][i]==a[1][i]==a[2][i]==0:ans="Yes" if a[0][0]==a[1][1]==a[2][2]==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
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) using ll = long long; int main() { int a[3][3], n, b[10]; bool ab[3][3], ans = false; rep(i, 3) rep(j, 3) ab[i][j] = false; rep(i, 3) rep(j, 3) cin >> a[i][j]; cin >> n; rep(i, n) cin >> b[i]; rep(i, 3) rep(j, 3)rep(k, n)...
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
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 b in [input()for i in range(int(input()))]: for l in range(9): S=S.replace(str([9,l][b==B[l]]),"") print(["No","Yes"][S.find(" ")>-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) { Scanner sc = new Scanner(System.in); boolean judge = false; //ビンゴ作成 int[][] bingo = new int[3][3]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { bingo[i][j] = sc.nextInt(); } } //ビンゴを回す fin...
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,B,C,D,E,F,G,H,J; cin>>A>>B>>C; cin>>D>>E>>F; cin>>G>>H>>J; int a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,j=0; int N; cin>>N; int Z; for (int i;i<N;i++) { cin>>Z; if(A==Z) a++; else if (B==Z) b++; else if (C==Z) c++; 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; int main(){ vector<int> A(9); copy_n(istream_iterator<int>(cin), 9, A.begin()); int n; cin >> n; vector<bool> C(9); for (int i = 0; i < n; i++){ int b; cin >> b; for (int i = 0; i < 9; i++){ C[i] = C[i] or (A[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
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[][] A = new int[3][3]; String res = ""; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { A[i][j] = sc.nextInt(); } } int N = 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
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int[] a=new int[101]; for(int i=1;i<=9;i++){ a[sc.nextInt()]=i; } boolean[] b=new boolean[10]; int n=sc.nextInt(); for(int i=0;i<n;i++){ b[a[sc.nextInt()]]=true; } ...
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 = [] for _ in range(3): A += list(map(int,input().split())) N = int(input()) B = [int(input()) for _ in range(N)] C = [0]*9 for i in B: if i in A: x = A.index(i) C[x] = 1 if C[0]*C[1]*C[2] == 1 or C[3]*C[4]*C[5]==1 or C[6]*C[7]*C[8] ==1 or C[0]*C[3]*C[6] ==1 or C[1]*C[4]*C[7]==1 or C[2]*C[5]*C[8] ==1 or C...
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(3)],[]) for b in [input()for i in range(int(input()))]: if b in A: S=S.replace(str(A.index(b)),"") print(["No","Yes"][S.find(" ")>-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
ary=[list(map(int,input().split()))for p in range(3)] for i in range(int(input())): data=int(input()) for j in range(3): for k in range(3): if ary[j][k]==data: ary[j][k]=0 ans="No" for i in range(3): if ary[i][0]==ary[i][1]==ary[i][2]==0 or ary[0][i]==ary[1][i]==ary[2][i]==0: ans="Yes" 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 sc = new Scanner(System.in); //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ int[][] bingo =new int[3][3]; boolean[][] isHit=new boolean[3][3]; for (int i=0;i<3;i++) { for (int j=0;j<3;j++) { bingo[i][j] =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
*a,=map(int,open(0).read().split());print('YNeos'[all(t-set(map(a.index,a[10:]))for t in({0,1,2},{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
#include <bits/stdc++.h> using namespace std; int main(){ int n; vector<int> card(9); for (int i=0; i<9; ++i) cin >>card[i]; cin >> n; for (int j=0; j<n; ++j){ int b; cin >> b; for(int i=0; i<9; ++i){ if(card[i]==b) card[i]=0; } } bool flag = 0; for (int k=0; k<3;++k){ if(card...
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(); } int n = sc.nextInt(); int num[] = 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
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) int main(){ int a[3][3]; bool hit[3][3]={}; rep(i,3)rep(j,3)cin>>a[i][j]; int n; cin >> n; int b[n]; rep(i,n){ cin >> b[i]; rep(j,3){ rep(k,3){ hit[j][k] = hit[j][k] || b[i]==a[j][k]; } } } int ans=0; rep(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
a = [list(map(int,input().split())) for i in range(3)] n = int(input()) b = [int(input()) for j in range (n)] ans = "No" for k in range (n): for l in range(3): for m in range(3): if a[l][m] == b[k]: a[l][m] = 0 for o in range(3): if a[o][0] == a[o][1] == a[o][2] or a[0][o] == a[1][o] == a[2][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
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int ls[3][3];vector<int> up(101,0); for(int u=0;u<3;u++){ for(int v=0;v<3;v++){ cin>>ls[u][v];}} int u,v,an=0,n,f=1;cin>>n; while(n--){ int a;cin>>a;up[a]=1;} for(u=0;u<3;u++){f=1; for(v=0;v<3;v++){ if(!up[ls[v][u]]){f=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 i in range(3)] n=int(input()) b=[int(input()) for i in range(n)] for i in range(3): for j in range(3): if a[i][j] in b: a[i][j]=0 ans='No' #tate for i in range(3): if a[0][i]+a[1][i]+a[2][i]==0: ans='Yes' #yoko for i in range(3): if sum(a[i])==0: ans='Yes' ...
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 _ in range(3): a += list(map(int, input().split())) n = int(input()) for _ in range(n): b = int(input()) if b in a: i = a.index(b) a[i] = 0 if sum(a[0:3]) == 0 or sum(a[3:6]) == 0 or sum(a[6:]) == 0 \ or sum(a[0::3]) == 0 or sum(a[1::3]) == 0 or sum(a[2::3]) == 0 \ or sum(...
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
f = lambda:list(map(int,input().split())) l = f() + f() + f() n = int(input()) s = set() for i in range(n): b = int(input()) if b in l: s|={l.index(b)} print(['No','Yes'][any(t<=s for t in [{0,1,2},{0,3,6},{0,4,8},{1,4,7}, {2,4,6},{2,5,8},{3,4,5},{6,7,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.Arrays; import java.util.Scanner; public class Main { static boolean isBingo(boolean B[][]){ for(int i = 0 ; i < 3 ; ++i){ boolean check = true; for(int j = 0 ; j < 3 ; ++j){ if(!B[i][j]){ check = false; } } if(check)return true; check = true; for(int j = 0 ; j < 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
a=[list(map(int,input().split())) for _ in range(3)] f=[[0]*3 for _ in range(3)] for _ in range(int(input())): x=int(input()) for i in range(3): for j in range(3): if x==a[i][j]: f[i][j]=1 ans=0 for i in range(3): if all(f[i][j] for j in range(3)) or all(f[j][i] for j in range(3)): ans=1 if ...
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]; bool b[3][3]; int main() { int p=0,i,j,k,l,n,t; memset(b,0,sizeof(b)); for(i=0;i<3;i++) { for(j=0;j<3;j++) scanf("%d",&a[i][j]); } scanf("%d",&n); for(l=0;l<n;l++) { scanf("%d",&t); for(i=0;i<3;i++) { for(j=0;j<3;j++) if(a[i][j]==t) b[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
def main(): aa = [] for _ in xrange(3): aa.extend(map(int, raw_input().split())) n = input() for _ in xrange(n): b = input() try: aa[aa.index(b)] = 0 except ValueError: continue for i in xrange(3): if sum(aa[i*3:i*3+3]) == 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
A = [] for i in range(3): A.append(list(input().split())) N = int(input()) B = [] for i in range(N): B.append(input()) B=set(B) if set(A[0]) <= B or set(A[1]) <= B or set(A[2]) <= B or {A[0][0], A[1][0], A[2][0]} <= B or\ {A[0][1], A[1][1], A[2][1]} <= B or {A[0][2], A[1][2], A[2][2]} <= B \ or {A[0][0], A[1][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]; int N; int b; int i; int j; int n; int flag = 0; Scanner sc = new Scanner(System.in); for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { A[i][j] = Integer.parseInt(sc.next()); ...
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],n,b; for(int i=0;i<9;i++) cin>>a[i]; cin>>n; for(int i=0;i<n;i++){ cin>>b; for(int& i:a) if(i==b) i=0; } cout<<(!(a[0]+a[1]+a[2])||!(a[3]+a[4]+a[5])||!(a[6]+a[7]+a[8])||!(a[0]+a[3]+a[6])||!(a[1]+a[4]+a[7])||!(a[2]+a[5]+a[8])||!(a[0]+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
import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[][] bingo = new int[3][3]; boolean[][] check = new boolean[3][3]; for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { bingo[i][j] = Integer....
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
al = [list(map(int, input().split())) for i in range(3)] al = sum(al, []) n = int(input()) bl = [int(input()) for i in range(n)] check = [0 for i in range(9)] for b in bl: if b in al: check[al.index(b)] = 1 if [1,1,1] in [check[:3], check[3:6], check[6:], check[0:7:3], check[1:8:3], check[2:9:3], check[...
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]; boolean[][] af = new boolean[3][3]; boolean flag = false; for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { a[i][j] = 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> using namespace std; int main(){ int a[9], n, b; bool c[9]; string res = "No"; for(int i=0; i<9; i++){ cin >> a[i]; c[i] = false; } cin >> n; for(int j=0; j<n; j++){ cin >> b; for(int i=0; i<9; i++){ if(a[i] == b){ c[i] = true; break; } } ...
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 [][]a = new int [3][3]; for(int i = 0 ;i < 3; i++) { for(int j = 0 ; j < 3 ;j++) { a[i][j] = Integer.parseInt(sc.next()); } } int n = Integer.parseInt(sc.next()...
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[][] a = new int[3][3]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { a[i][j] = scanner.nextInt(); } } int n = 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
A=[] for i in [0]*3: A+=list(map(int,input().split())) N=int(input()) B=[0]*9 for i in range(N): i=int(input()) if i in A: B[A.index(i)]=1 res=0 for i in range(3): res+=B[3*i]*B[3*i+1]*B[3*i+2] res+=B[i]*B[i+3]*B[i+6] res+=B[0]*B[4]*B[8]+B[2]*B[4]*B[6] print(['No','Yes'][res>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.*; 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] = Integer.parseInt(sc.next()); } } int n = Integer.parseInt(sc.next()); int b =...
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
(lambda A:(lambda N:(lambda C:(lambda d:(lambda B:print (["No","Yes"][3 in{sum(B[2: 8:2]),sum(B[::4])}|{sum(B[i *3:i*3+3])for i in range(3) } | { sum(B[i::3] )for i in range(3)} ] ) ) ( list(map( lambda x:d[x],A))))([x in C for x in range(101)]))({int (input())for x in range(N)} ))(int(input())))(list(map( int,input()....
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]; bool b[3][3]; for(int i=0; i< 3; i++) for(int j=0; j < 3; j++){ cin >> a[i][j]; b[i][j] = false;} int n; cin >> n; for(int q=0; q < n; q++) { int t; cin >> t; for(int i=0; i< 3; i++) for(int j=0; j < 3; j++) if(a[i][j] == t) b[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
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[][] b = new int[3][3]; for(int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { b[i][j] = sc.nextInt(); } } int N = 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
a=list(map(int," ".join([input() for i in range(3)]).split())) n=int(input()) b=[int(input())for i in range(n)] for i in b: if i in a: p=a.index(i) a[p]="*" p=0 for i in range(3): if a[i]==a[i+3]==a[i+6]=="*": p+=1 for i in range(3): if a[3*i]==a[3*i+1]==a[3*i+2]=="*": p+=1 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=[] for i in range(3): a,b,c=map(int,input().split()) A+=[a,b,c] n=int(input()) T=[0]*9 for i in range(n): p=int(input()) if p in A: T[A.index(p)]=1 if [1,1,1] in [T[0:3],T[3:6],T[6:9],T[0:7:3],T[1:9:3],T[2:9:3],T[0:10:4],T[2:7:2]]: 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
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] value = new int[9]; boolean[] flags = new boolean[9]; for(int i = 0; i < 9; i++) { value[i] = sc.nextInt(); } int N = sc.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
import java.io.FileNotFoundException; import java.util.Scanner; public class Main { public static void main(String[] args) throws FileNotFoundException { // File file = new File("src/in.txt"); // Scanner sc = new Scanner(file); Scanner sc = new Scanner(System.in); int[][] A = new int[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
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 set(A[i]) <= set(b): print("Yes") exit() if set([A[0][i], A[1][i], A[2][i]]) <= set(b): print("Yes") exit() if set([A[0][0], A[1][1], A[2][2]]) <= set(b) 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
#include<iostream> #include<cstdio> #include<cstring> #include<queue> #include<stack> #include<cmath> #include<algorithm> #include<map> typedef long long ll; using namespace std; #define INF 0x3f3f3f3f int main() { int n,i,j,t,k,flag=0,a[6][6]; for(i=1;i<=3;i++) for(j=1;j<=3;j++) cin>>a[i][j]; cin>>n; for(k=1;k<=...
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[][] 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]; boolean[][] bi = 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
#include<iostream> using namespace std; int main(){ int a[3][3], b, s[3][3] = {}; for(int i = 0; i < 3; i++) for(int j = 0; j < 3; j++) { cin >> a[i][j]; } int n; 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]) s[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; #define int long long int a[9]; bool ok[9]; vector<vector<int>> ls = {{0,1,2}, {3,4,5}, {6,7,8}, {0,3,6}, {1,4,7}, {2,5,8}, {0,4,8}, {2,4,6}}; int32_t main() { ios::sync_with_stdio(0);cin.tie(0); for(int i=0; i<9; i++) { cin >> a[i]; } int n; cin >> n; for(int 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
row1 = map(int, input().split()) row2 = map(int, input().split()) row3 = map(int, input().split()) row = list(row1) + list(row2) + list(row3) bs = [int(input()) for i in range(int(input()))] comb = [ [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 lst 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
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 b in [input()for i in range(int(input()))]: if b in B: S=S.replace(str(B.index(b)),"") print(["No","Yes"][S.find(" ")>-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
a = [list(map(int, input().split())) for _ in range(3)] n = int(input()) b = [int(input()) for _ in range(n)] bingo = 'No' for t in zip(*a): a.append(list(t)) a.append([a[i][i] for i in range(3)]) a.append([a[i][2-i]for i in range(3)]) for line in a: if all(item in b for item in line): bingo = 'Yes'...
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 java.lang.Math; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n; int h[] = {0,0,0}; int w[] = {0,0,0}; int c[] = {0,0}; int stack; int stack1; int stack2; int stack3; boolean nb = true; ...
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 flp(i, s, n) for(int i=0; i<n; i++) int main(void) { 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; for(int i=0; i<n; i++) { int b; cin>>b; for(int x=0; x<3; x++) { for(int y=0; y<3; y++) if(A[x]...
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]; boolean[][] b=new boolean[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 pre; for(int 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<iostream> #include<string> using namespace std; int num[100]={0}; int main(){ int i,j,n,a[3][3],cnt=0,b; for(int i=0; i<3; i++){ for(int j=0; j<3; j++){ cin >> a[i][j]; } } cin >> n; for(i=0; i<n; i++){ cin >> b; num[b]++; } for(i=0; i<3; i++){ if(num[a[i][1]]&&num[a[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 a[9],b[9],n,x; int main() { for(int i=0;i<9;++i) scanf("%d",&a[i]); scanf("%d",&n); while(n--){ scanf("%d",&x); for(int i=0;i<9;++i){ if(x==a[i]){ b[i]=1; break; } } } for(int i=0;i<3;++i){ if(b[i]&&b[i+3]&&b[i+6]){ printf("Yes"); return ...
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[][] card = new int[3][3]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { card[i][j] = 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> using namespace std; int main(){ int a[1010], n, b; for (int i = 0; i < 9; i++) cin >> a[i]; cin >> n; for (int i = 0; i < n; i++) { cin >> b; for (int j = 0; j < 9; j++) if (a[j] == b) a[j] = 0; } if (a[0] + a[1] + a[2] == 0 || a[3] + a[4] + a[5] == 0 || a[6] + a[7] + a[8] == 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)] b=[i for i in [int(input()) for _ in range(int(input()))] for j in A if i in j] A=[[0 if A[i][j] in b else A[i][j] for j in range(len(A[i]))] for i in range(len(A))] print('NYoe s'[any([1 if sum(i)==0 else 0 for i in A]) or any([1 if sum(i)==0 else 0 for i in list(zi...
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.*; import java.util.*; class Main { static final String YES = "Yes"; static final String NO = "No"; public static void main(String[] args) throws Exception { final Scanner sc = new Scanner(System.in); long[][] A = new long[(int) (3)][(int) (3)]; for (int i = 0; i < 3; i++) { for (int j = 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
#include<stdio.h> int main(void) { int i,j,k,a[3][3],n,b[10],bingo=0; for(i=0; i<3; i++) { for(j=0; j<3; j++) scanf("%d",&a[i][j]); } scanf("%d",&n); for(k=0; k<n; k++) scanf("%d",&b[k]); for(i=0; i<3; i++) { for(j=0; j<3; j++) { for(k=0; k<n; k++) if(a[i][j]==b[k]) a[i][j]=1000; ...
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[][] A = new int[3][3]; boolean[][] R = new boolean[3][3]; for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { A[i][j] = sc.nextInt(); R[i][j] = false; } } 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
import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int a[][]=new int[4][4]; for (int i=1;i<=3;i++) { for (int j=1;j<=3;j++) { a[i][j]=sc.nextInt(); } } int n=sc.nextInt(); ArrayList<Integer>b=new ArrayList<Int...
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 sc = new Scanner(System.in); int sheet[][] = new int[3][3]; for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { sheet[i][j] = sc.nextInt(); } } int N = sc.nextInt(); for(int n = 0; n < N; 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
#include <bits/stdc++.h> using namespace std; int arr[3][3]; int main() { int a, b, c, d, e, f, g, h, i; cin>>a>>b>>c>>d>>e>>f>>g>>h>>i; int n; cin>>n; vector<bool> bn(101); for(int j=0;j<n;j++){ int t;cin>>t; bn[t] = true; } bool bingo= (bn[a]&&bn[b]&&bn[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.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int indexListW[][] = { {0 , 0 , 0} , { 0 , 1 , 2} , {0 , 1 , 2} , {1 , 1 , 1} , {0 , 1 , 2} , {2 , 2 , 2} , {0 , 1 , 2} ,{0 , 1 , 2} }; int indexListH[][] = { {0 , 1 , 2} , { 0 , 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
#include <bits/stdc++.h> using namespace std; int main(){ vector<int> vec(9); for(int i=0;i<9;i++){ cin>>vec.at(i); } int N; cin>>N; for(int i=0;i<N;i++){ int b; cin>>b; for(int j=0;j<9;j++){ if(vec.at(j)==b){ vec.at(j)=0; } } } if((vec.at(0)+vec.at(1)+vec.at(2))==0||(vec.at(3)+vec....
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 scan = new Scanner(System.in); int[][] grid = new int[3][3]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { grid[i][j] = scan.nextInt(); } } int n = scan.nextInt(); 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<iostream> using namespace std; int main(){ int a[3][3],c[3][3]={{0,0,0},{0,0,0},{0,0,0}}; 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=0;i<n;i++){ int b; cin>>b; for(int i=0;i<3;i++)for(int j=0;j<3;j++)c[i][j]=(c[i][j]||(b==a[i][j])); } int f=0; 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
#include <stdio.h> #define maxn 105 int a[5][5],b[maxn],vis[5][5]; int main(){ int i,j,n,k,flag=0; for(i=1;i<=3;i++) for(j=1;j<=3;j++) scanf("%d",&a[i][j]); scanf("%d",&n); for(i=1;i<=n;i++)scanf("%d",&b[i]); for(i=1;i<=n;i++) for(j=1;j<=3;j++) for(k=1;k<=3;k++) if(b[i]==a[j][k])vis[j][k]=1; for(i=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 java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); //BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw = new PrintWriter(System.out); StringTokenizer st; int[...
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; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[][] a = new int[3][3]; int[] b = new int[10]; boolean[][] appear = new boolean[3][3]; String ans = "No"; for(int i = 0; i < 3; i++){ for(int j = 0; j < 3; j++){ a[i][j] = sc...
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, a[3][3]; bool b[3][3]; bool f(){ for(int i = 0; i < 3; ++i) if(b[i][0]&&b[i][1]&&b[i][2]) return true; for(int j = 0; j < 3; ++j) if(b[0][j]&&b[1][j]&&b[2][j]) return true; if(b[0][0]&&b[1][1]&&b[2][2]) return true; if(b[0][2]&&b[1][1]&&b[2][0]) return true; r...
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<stdio.h> int main() { int num[9], a[9]={0}, x=1, n, i,j, b; for(i=0; i<9; i++) scanf("%d", num+i); scanf("%d", &n); for(j=0; j<n; j++) { scanf("%d", &b); for(i=0; i<9; i++) { if(num[i]==b) { a[i]=x; break; } } } if((a[0]==x&&a[1]==x&&a[2]==x) ||(a[3]==x&&a[4]==x&&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
A = [list(map(int,input().split())) for _ in range(3)] n = int(input()) B = [int(input()) for _ in range(n)] F = [0]*101 for b in B: F[b]=1 ans = 'No' for i in range(3): c = 0 d = 0 for j in range(3): c += F[A[i][j]] d += F[A[j][i]] if c==3 or d==3: ans ='Yes' if F[A[0][0]]+F[A[1][1]]+F[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
A = [] for _ in range(3): for e in list(map(int, input().split())): A.append(e) N = int(input()) for _ in range(N): n = int(input()) if n in A: A[A.index(n)] = 0 patterns = [ [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 pattern in patter...
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
p,r=input,range A=sum([list(map(int,p().split()))for _ in r(3)],[]) b=[int(p())for _ in r(int(p()))] 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
l=[list(map(int,input().split())) for i in range(3)] l=sum(l,[]) n=int(input()) li=set([int(input()) for ini in range(n)]) d=[0 for i in range(9)] for g in range(9): if l[g] in li:d[g]=1 for a,s,x in [(0,1,2),(3,4,5),(6,7,8),(0,4,8),(2,4,6),(0,3,6),(1,4,7),(2,5,8)]: if d[a]==d[x]==d[s]==1: print("Yes");exit() ...
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()))for i in range(3)] b=[int(input())for i in range(int(input()))] for i in range(3): X[i]=[1 if i in b else 0 for i in X[i]] print("Yes" if 3<=max(*[sum(i)for i in X],*[sum([x[i] for x in X])for i in range(3)],X[0][0]+X[1][1]+X[2][2],X[0][2]+X[1][1]+X[2][0]) 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
#include <iostream> using namespace std; int main() { int A[9]; for (int i = 0; i < 9; i++) cin >> A[i]; int N; cin >> N; for (int i = 0; i < N; i++) { int b; cin >> b; for (int j = 0; j < 9; j++) if (A[j] == b) A[j] = 0; } if (A[0] + A[1] + A[2] == 0 || A[3] + A[4] + A[5] == 0 || A[6] + A[7] + A[8] =...
CPP