Submission #10431636


Source Code Expand

Copy
void main() {
	auto A = readMatrix!int(3, 3).join.array;
	auto N = ri;
	auto arr2 = new bool[](9);
	foreach(i; 0..N) {
		auto b = ri;
		foreach(j; 0..9) {
			if(A[j] == b) arr2[j] = true;
		}
	}
	auto arr = [
		[0,1,2],
		[3,4,5],
		[6,7,8],
		[0,3,6],
		[1,4,7],
		[2,5,8],
		[0,4,8],
		[2,4,6]
	];
	foreach(v; arr) {
		bool flag = true;
		foreach(k; v) {
			if(!arr2[k]) flag = false;
		}
		if(flag) {
			writeln("Yes");
			return;
		}
	}
	writeln("No");
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

Submission Info

Submission Time
Task B - Bingo
User private_yusuke
Language D (DMD64 v2.070.1)
Score 200
Code Size 1513 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