結果

問題 No.607 開通777年記念
ユーザー DrDrpilotDrDrpilot
提出日時 2022-01-21 14:04:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,001 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 121 ms
コンパイル使用メモリ 10,940 KB
実行使用メモリ 48,864 KB
最終ジャッジ日時 2023-08-16 19:20:00
合計ジャッジ時間 3,378 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,472 KB
testcase_01 AC 18 ms
8,476 KB
testcase_02 AC 17 ms
8,532 KB
testcase_03 AC 17 ms
8,536 KB
testcase_04 AC 17 ms
8,504 KB
testcase_05 AC 17 ms
8,472 KB
testcase_06 AC 17 ms
8,452 KB
testcase_07 AC 136 ms
10,864 KB
testcase_08 AC 18 ms
8,492 KB
testcase_09 AC 27 ms
9,040 KB
testcase_10 AC 23 ms
8,936 KB
testcase_11 AC 936 ms
48,864 KB
testcase_12 AC 1,001 ms
48,864 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