Submission #10431833


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


int nextInt() { int x; scanf("%d", &x); return x;}
ll nextLong() { ll x; scanf("%lld", &x); return x;}

int main2() {

  int t[3][3];
  REP(i, 3) REP(j, 3) cin >> t[i][j];

  int N; cin >> N;
  REP(n, N) {
    int x; cin >> x;
    REP(i, 3) REP(j, 3) if (t[i][j] == x) t[i][j] = -1;
  }
  bool yes = false;
  REP(i, 3) {
    int k = 0;
    REP(j, 3) if (t[i][j] == -1) k++;
    if (k == 3) yes = true;
  }
  REP(j, 3) {
    int k = 0;
    REP(i, 3) if (t[i][j] == -1) k++;
    if (k == 3) yes = true;
  }
  {
    int k = 0;
    REP(i, 3) {
      if (t[i][i] == -1) k++;
    }
    if (k == 3) yes = true;
  }
  {
    int k = 0;
    REP(i, 3) {
      if (t[i][2-i] == -1) k++;
    }
    if (k == 3) yes = true;
  }


  if (yes)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

int main() {

#ifdef LOCAL
  for (;!cin.eof();cin>>ws)
#endif
    main2();
  return 0;
}

Submission Info

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

Compile Error

./Main.cpp: In function ‘int nextInt()’:
./Main.cpp:14:39: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
 int nextInt() { int x; scanf("%d", &x); return x;}
                                       ^
./Main.cpp: In function ‘ll nextLong()’:
./Main.cpp:15:40: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
 ll nextLong() { ll x; scanf("%lld", &x); return x;}
                                        ^

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