結果

問題 No.607 開通777年記念
ユーザー ttrttr
提出日時 2020-02-22 20:32:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 430 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-04-18 03:04:15
合計ジャッジ時間 3,463 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 30 ms
10,880 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 AC 30 ms
10,752 KB
testcase_07 AC 208 ms
11,008 KB
testcase_08 AC 31 ms
10,752 KB
testcase_09 AC 38 ms
10,752 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 795 ms
11,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int, input().split())
ans = "NO"
L = [0]*N
for _ in range(M):
    A = [int(a) for a in input().split()]
    for i in range(N):
        L[i] += A[i]
    S = [0]*(N+1)
    for i in range(N):
        S[i+1] = S[i]+L[i]
    l = 0
    r = 1
    while l < r < N+1 and ans == "NO":
        if S[r]-S[l] < 777:
            r += 1
        elif S[r]-S[l] > 777:
            l += 1
        else:
            ans = "YES"

print(ans)
0