結果

問題 No.607 開通777年記念
ユーザー ninja-kid
提出日時 2022-06-09 14:43:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 152 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 77,312 KB
最終ジャッジ日時 2024-09-21 05:35:30
合計ジャッジ時間 2,385 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
count = [0] * N
from collections import deque
for _ in range(M):
  A = list(map(int, input().split()))
  for i in range(N):
    count[i] += A[i]
  q = deque()
  jokyaku = 0
  for c in count:
    q.append(c)
    jokyaku += c
    while q and jokyaku > 777:
      t = q.popleft()
      jokyaku -= t
    if jokyaku == 777:
      print("YES")
      exit()
print("NO")
0