Submission #10735682


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair < int, int >;

int main() {
	int m = 3, x, n;
	map < int, pii > mp;
	for (int i = 0; i < m; i++) {
		for (int j = 0; j < m; j++) {
			cin >> x;
			mp[x] = make_pair (i, j);
		}
	}
	vector < int > rows (m), cols(m), diag(2);
	cin >> n;
	while (n--) {
		cin >> x;
		if (mp.find (x) == mp.end()) continue;
		pii p = mp[x];
		rows[p.first]++;
		cols[p.second]++;
		if (p.first == p.second) diag[0]++;
		if (p.first + p.second == m - 1) diag[1]++;
	}
	for (int row : rows) {
		if (row >= m) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	for (int col : cols) {
		if (col >= m) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	for (int d: diag) {
		if (d >= m) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
	return 0;	
}

Submission Info

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

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 KiB
00-sample-281 AC 1 ms 256 KiB
00-sample-511 AC 1 ms 256 KiB
01-random-134 AC 1 ms 256 KiB
01-random-238 AC 1 ms 256 KiB
01-random-292 AC 1 ms 256 KiB
01-random-297 AC 1 ms 256 KiB
01-random-314 AC 1 ms 256 KiB
01-random-329 AC 1 ms 256 KiB
01-random-352 AC 1 ms 256 KiB
01-random-387 AC 1 ms 256 KiB
01-random-392 AC 1 ms 256 KiB
01-random-420 AC 1 ms 256 KiB
01-random-462 AC 1 ms 256 KiB
01-random-500 AC 1 ms 256 KiB
01-random-86 AC 1 ms 256 KiB