結果

問題 No.607 開通777年記念
ユーザー tails1434tails1434
提出日時 2020-02-14 07:31:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 203 ms / 2,000 ms
コード長 613 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 77,184 KB
最終ジャッジ日時 2024-04-16 00:06:30
合計ジャッジ時間 2,145 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,840 KB
testcase_01 AC 40 ms
51,968 KB
testcase_02 AC 39 ms
52,224 KB
testcase_03 AC 40 ms
52,096 KB
testcase_04 AC 40 ms
51,968 KB
testcase_05 AC 41 ms
52,096 KB
testcase_06 AC 41 ms
52,096 KB
testcase_07 AC 203 ms
76,220 KB
testcase_08 AC 40 ms
51,968 KB
testcase_09 AC 59 ms
64,896 KB
testcase_10 AC 54 ms
62,208 KB
testcase_11 AC 153 ms
77,184 KB
testcase_12 AC 149 ms
76,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N, M = map(int, input().split())
    A = [0] * N
    flag = False
    for _ in range(M):
        B = list(map(int, input().split()))
        for i in range(N):
            A[i] += B[i]
        
        
        for left in range(N):
            tmp = 0
            right = left
            while right < N:
                if tmp >= 777:
                    break
                tmp += A[right]
                right += 1
            
            if tmp == 777:
                flag = True

    if flag:
        print('YES')
    else:
        print('NO')




if __name__ == "__main__":
    main()
0