結果

問題 No.607 開通777年記念
ユーザー Mr.FukuMr.Fuku
提出日時 2018-08-07 13:04:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 801 ms / 2,000 ms
コード長 380 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 11,988 KB
実行使用メモリ 10,464 KB
最終ジャッジ日時 2023-10-19 22:25:54
合計ジャッジ時間 2,930 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,100 KB
testcase_01 AC 30 ms
10,100 KB
testcase_02 AC 29 ms
10,100 KB
testcase_03 AC 30 ms
10,100 KB
testcase_04 AC 29 ms
10,100 KB
testcase_05 AC 30 ms
10,100 KB
testcase_06 AC 30 ms
10,100 KB
testcase_07 AC 66 ms
10,220 KB
testcase_08 AC 31 ms
10,100 KB
testcase_09 AC 38 ms
10,156 KB
testcase_10 AC 30 ms
10,116 KB
testcase_11 AC 727 ms
10,464 KB
testcase_12 AC 801 ms
10,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
train = [0]*N

for i in range(M):
    passenger = list(map(int,input().split()))
    cnt = 0
    left = 0
    for right in range(N):
        train[right] += passenger[right]
        cnt+=train[right]
        while cnt>777:
            cnt-=train[left]
            left+=1
        if cnt==777:
            print("YES")
            exit(0)
print("NO")
0