結果

問題 No.3819 TSG BINGO (Python)
コンテスト
ユーザー alcea
提出日時 2026-11-20 23:28:00
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 39 ms / 2,000 ms
+ 355µs
コード長 997 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 83 ms
コンパイル使用メモリ 64,584 KB
実行使用メモリ 58,420 KB
スコア 100
最終ジャッジ日時 2026-11-21 14:34:14
合計ジャッジ時間 3,638 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge2_0
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

A = [list(map(int,input().split())) for _ in range(5)]
N = int(input())
is_marked = [[0]*5 for _ in range(5)]
is_marked[2][2] = 1
for _ in range(N):
  b = int(input())
  for j in range(5):
    for k in range(5):
      if b == A[j][k]:
        is_marked[j][k] = 1
  bingo = 0
  #横1列
  for i in range(5):
    if all(is_marked[i]):
      bingo += 1
  #縦1列
  for j in range(5):
    if all(is_marked[i][j] for i in range(5)):
      bingo += 1
  #斜め1列
  if all(is_marked[i][i] for i in range(5)):
    bingo += 1
  if all(is_marked[i][4-i] for i in range(5)):
    bingo += 1
  #T
  if all(is_marked[0]) and all(is_marked[i][2] for i in range(5)):
    bingo += 1
  #S
  if all(is_marked[0]) and all(is_marked[2]) and all(is_marked[4]) and is_marked[1][0] and is_marked[3][4]:
    bingo += 1
  #G
  if all(is_marked[0]) and all(is_marked[4]) and is_marked[1][0] and is_marked[2][0] and is_marked[3][0] and is_marked[2][3] and is_marked[2][4] and is_marked[3][4]:
    bingo += 1
  print(bingo)
0