結果

問題 No.607 開通777年記念
ユーザー Bioinfo_KBioinfo_K
提出日時 2017-12-07 21:02:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,498 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 10,940 KB
実行使用メモリ 8,456 KB
最終ジャッジ日時 2023-08-19 12:20:08
合計ジャッジ時間 4,733 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,172 KB
testcase_01 AC 17 ms
7,896 KB
testcase_02 AC 17 ms
8,232 KB
testcase_03 AC 16 ms
8,148 KB
testcase_04 AC 16 ms
7,920 KB
testcase_05 AC 16 ms
8,232 KB
testcase_06 AC 16 ms
8,132 KB
testcase_07 AC 716 ms
8,264 KB
testcase_08 AC 16 ms
7,856 KB
testcase_09 AC 30 ms
7,832 KB
testcase_10 AC 16 ms
8,144 KB
testcase_11 AC 1,308 ms
8,456 KB
testcase_12 AC 1,498 ms
8,444 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