結果

問題 No.607 開通777年記念
ユーザー DrDrpilotDrDrpilot
提出日時 2022-01-21 14:04:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 219 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 87,448 KB
最終ジャッジ日時 2023-08-16 19:20:05
合計ジャッジ時間 2,894 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
71,732 KB
testcase_01 AC 81 ms
71,744 KB
testcase_02 AC 82 ms
71,528 KB
testcase_03 AC 81 ms
71,588 KB
testcase_04 AC 80 ms
71,756 KB
testcase_05 AC 80 ms
71,748 KB
testcase_06 AC 82 ms
71,724 KB
testcase_07 AC 131 ms
80,200 KB
testcase_08 AC 90 ms
71,600 KB
testcase_09 AC 97 ms
77,580 KB
testcase_10 AC 87 ms
77,304 KB
testcase_11 AC 199 ms
87,448 KB
testcase_12 AC 219 ms
87,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
n,m=map(int,input().split())
a=[list(map(int,input().split())) for _ in range(m)]
for i in range(1,m):
    for j in range(n):
        a[i][j]+=a[i-1][j]
for i in range(m):
    q=deque()
    now=0
    for j in range(n):
        now+=a[i][j]
        q.append(a[i][j])
        while q and now>777:
            out=q.popleft()
            now-=out
        if now==777:
            print('YES')
            exit()
print('NO')
0