結果

問題 No.607 開通777年記念
ユーザー Bioinfo_KBioinfo_K
提出日時 2017-12-07 21:04:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 304 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 86,780 KB
実行使用メモリ 77,984 KB
最終ジャッジ日時 2023-08-19 12:20:15
合計ジャッジ時間 3,026 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,396 KB
testcase_01 AC 74 ms
71,172 KB
testcase_02 AC 75 ms
71,280 KB
testcase_03 AC 74 ms
71,024 KB
testcase_04 AC 74 ms
71,408 KB
testcase_05 AC 75 ms
71,484 KB
testcase_06 AC 76 ms
71,196 KB
testcase_07 AC 304 ms
77,512 KB
testcase_08 AC 77 ms
70,932 KB
testcase_09 AC 95 ms
76,592 KB
testcase_10 AC 77 ms
71,344 KB
testcase_11 AC 294 ms
77,892 KB
testcase_12 AC 304 ms
77,984 KB
権限があれば一括ダウンロードができます

ソースコード

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