Submission #10431070


Source Code Expand

Copy
#define  _CRT_SECURE_NO_WARNINGS
#pragma comment (linker, "/STACK:526000000")

#include "bits/stdc++.h"

using namespace std;
typedef string::const_iterator State;
#define eps 1e-11L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL

#define MOD 998244353LL
#define seg_size 262144
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()

unsigned long xor128() {
	static unsigned long x = 123456789, y = 362436069, z = 521288629, w = time(NULL);
	unsigned long t = (x ^ (x << 11));
	x = y; y = z; z = w;
	return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}
void init() {
	iostream::sync_with_stdio(false);

}

int grid[3][3] = {};
void solve() {
	REP(i, 3) {
		REP(q, 3) {
			cin >> grid[i][q];
		}
	}
	int n;
	cin >> n;
	REP(i, n) {
		int a;
		cin >> a;
		REP(q, 3) {
			REP(j, 3) {
				if (grid[q][j] == a) {
					grid[q][j] = -1;
				}
			}
		}
	}
	REP(i, 3) {
		int ok = 1;
		REP(q, 3) {
			if (grid[i][q] != -1) ok = 0;
		}
		if (ok == 1) {
			cout << "Yes" << endl;
			return;
		}
		ok = 1;
		REP(q, 3) {
			if (grid[q][i] != -1) ok = 0;
		}
		if (ok == 1) {
			cout << "Yes" << endl;
			return;
		}
	}
	if (grid[0][0] == -1 && grid[1][1] == -1 && grid[2][2] == -1) {
		cout << "Yes" << endl;
		return;
	}
	if (grid[2][0] == -1 && grid[1][1] == -1 && grid[0][2] == -1) {
		cout << "Yes" << endl;
		return;
	}
	cout << "No" << endl;
}

int main() {
	init();
	solve();
}

Submission Info

Submission Time
Task B - Bingo
User kotamanegi
Language C++14 (GCC 5.4.1)
Score 200
Code Size 1478 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 16
Set Name Test Cases
Sample 00-sample-0, 00-sample-281, 00-sample-511
All 00-sample-0, 00-sample-281, 00-sample-511, 01-random-134, 01-random-238, 01-random-292, 01-random-297, 01-random-314, 01-random-329, 01-random-352, 01-random-387, 01-random-392, 01-random-420, 01-random-462, 01-random-500, 01-random-86
Case Name Status Exec Time Memory
00-sample-0 AC 1 ms 256 KB
00-sample-281 AC 1 ms 256 KB
00-sample-511 AC 1 ms 256 KB
01-random-134 AC 1 ms 256 KB
01-random-238 AC 1 ms 256 KB
01-random-292 AC 1 ms 256 KB
01-random-297 AC 1 ms 256 KB
01-random-314 AC 1 ms 256 KB
01-random-329 AC 1 ms 256 KB
01-random-352 AC 1 ms 256 KB
01-random-387 AC 1 ms 256 KB
01-random-392 AC 1 ms 256 KB
01-random-420 AC 1 ms 256 KB
01-random-462 AC 1 ms 256 KB
01-random-500 AC 1 ms 256 KB
01-random-86 AC 1 ms 256 KB