結果

問題 No.607 開通777年記念
ユーザー 👑 H20H20
提出日時 2021-05-03 11:16:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 182 ms / 2,000 ms
コード長 438 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 78,204 KB
最終ジャッジ日時 2023-09-29 05:48:51
合計ジャッジ時間 2,816 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,504 KB
testcase_01 AC 79 ms
71,632 KB
testcase_02 AC 77 ms
71,316 KB
testcase_03 AC 74 ms
71,436 KB
testcase_04 AC 77 ms
71,448 KB
testcase_05 AC 75 ms
71,408 KB
testcase_06 AC 74 ms
71,596 KB
testcase_07 AC 96 ms
76,924 KB
testcase_08 AC 77 ms
71,436 KB
testcase_09 AC 84 ms
76,772 KB
testcase_10 AC 72 ms
71,160 KB
testcase_11 AC 173 ms
78,204 KB
testcase_12 AC 182 ms
78,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int, input().split())
TRAIN = [0]*N
for _ in range(M):
    L = list(map(int,input().split()))
    for i in range(N):
        TRAIN[i] += L[i]
    passenger=0
    j=0
    for i in range(N+1):
        while j<N and passenger<777:
            passenger += TRAIN[j]
            j += 1
        if passenger==777:
            print('YES')
            exit()
        if i==N:
            break
        passenger -= TRAIN[i]
print('NO')
0