結果

問題 No.607 開通777年記念
ユーザー Bioinfo_K
提出日時 2017-12-07 21:02:21
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,822 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-29 05:11:46
合計ジャッジ時間 5,492 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def Is(): return [int(x) for x in sys.stdin.readline().split()]

n,m = Is()
a = [0]*n
for i in range(m):
    t = Is()
    for j in range(n):
        a[j] += t[j]
    l,r = 0,1
    for i in range(2*n):
        s = sum(a[l:r])
        if s == 777:
            print("YES")
            exit()
        elif s < 777:
            r += 1
        else:
            l += 1
        if r > n:
            continue
print("NO")
0