Submission #10432971
Source Code Expand
Copy
#pragma GCC optimize ("Ofast")
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i=(a); i<(int)(b); i++)
#define FORD(i, a, b) for (int i=a; i>(int)(b); i--)
#define PPC(x) __builtin_popcount(x)
#define MSB(x) (31 - __builtin_clz(x))
#define pb push_back
#define ALL(x) (x).begin(), (x).end()
#define ithBit(m, i) ((m) >> (i) & 1)
#define ft first
#define sd second
#ifdef DEBUG
#include "debug.h"
#else
#define dbg(...) 0
#endif
using namespace std;
const int maxN = 1 << 17;
bool vis[maxN];
int T[3][3];
bool checkRow(int i)
{
FOR(j, 0, 3)
if (!vis[T[i][j]])
return false;
return true;
}
bool checkCol(int j)
{
FOR(i, 0, 3)
if (!vis[T[i][j]])
return false;
return true;
}
void solve()
{
FOR(i, 0, 3) FOR(j, 0, 3)
scanf ("%d", &T[i][j]);
int n;
scanf ("%d", &n);
while (n--)
{
int a;
scanf ("%d", &a);
vis[a]= true;
}
bool res = false;
FOR(i, 0, 3)
if (checkRow(i) or checkCol(i))
res = true;
if (vis[T[1][1]] and ((vis[T[0][0]] and vis[T[2][2]]) or (vis[T[0][2]] and vis[T[2][0]])))
res = true;
printf("%s\n", res ? "Yes" : "No");
}
int main()
{
int t;
t = 1;//scanf ("%d", &t);
while (t--)
solve();
return 0;
}
Submission Info
Submission Time |
|
Task |
B - Bingo |
User |
bgrm |
Language |
C++14 (GCC 5.4.1) |
Score |
200 |
Code Size |
1280 Byte |
Status |
AC |
Exec Time |
1 ms |
Memory |
256 KB |
Compile Error
./Main.cpp: In function ‘void solve()’:
./Main.cpp:43:25: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf ("%d", &T[i][j]);
^
./Main.cpp:45:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf ("%d", &n);
^
./Main.cpp:49:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf ("%d", &a);
^
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
200 / 200 |
Status |
|
|
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 |