結果

問題 No.607 開通777年記念
ユーザー brthyyjpbrthyyjp
提出日時 2020-04-10 10:58:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 177 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 78,112 KB
最終ジャッジ日時 2023-10-12 21:14:55
合計ジャッジ時間 2,501 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
70,984 KB
testcase_01 AC 72 ms
71,244 KB
testcase_02 AC 72 ms
71,216 KB
testcase_03 AC 72 ms
71,224 KB
testcase_04 AC 79 ms
71,256 KB
testcase_05 AC 72 ms
71,332 KB
testcase_06 AC 72 ms
71,408 KB
testcase_07 AC 91 ms
76,700 KB
testcase_08 AC 72 ms
70,988 KB
testcase_09 AC 91 ms
77,332 KB
testcase_10 AC 72 ms
71,168 KB
testcase_11 AC 177 ms
78,112 KB
testcase_12 AC 177 ms
77,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
B = [0]*n
from itertools import accumulate
for i in range(m):
    A = list(map(int, input().split()))
    for i in range(n):
        B[i] += A[i]
    s = 0
    t = 0
    S = 0
    for s in range(n):
        while t < n and S < 777:
            S += B[t]
            t += 1
        if S == 777:
            print('YES')
            exit()
        if s == t:
            t += 1
        else:
            S -= B[s]
else:
    print('NO')
0