結果

問題 No.607 開通777年記念
ユーザー maspymaspy
提出日時 2020-01-29 10:54:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 368 ms / 2,000 ms
コード長 524 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 10,868 KB
実行使用メモリ 96,196 KB
最終ジャッジ日時 2023-10-14 05:23:14
合計ジャッジ時間 5,719 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
29,768 KB
testcase_01 AC 131 ms
29,732 KB
testcase_02 AC 132 ms
29,692 KB
testcase_03 AC 130 ms
29,740 KB
testcase_04 AC 132 ms
29,768 KB
testcase_05 AC 131 ms
29,728 KB
testcase_06 AC 129 ms
29,652 KB
testcase_07 AC 165 ms
33,636 KB
testcase_08 AC 133 ms
29,696 KB
testcase_09 AC 136 ms
30,388 KB
testcase_10 AC 131 ms
30,400 KB
testcase_11 AC 368 ms
96,196 KB
testcase_12 AC 367 ms
95,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N,M = map(int,readline().split())
As = np.array(read().split(),np.int64).reshape(M,N)

np.cumsum(As, out=As, axis=0)

def find_777(A):
    Acum = np.zeros(len(A) + 1)
    Acum[1:] = np.cumsum(A)
    x = np.searchsorted(Acum, Acum+777, 'right')
    x -= np.searchsorted(Acum, Acum+777, 'left')
    return np.any(x)

answer = 'YES' if any(find_777(A) for A in As) else 'NO'
print(answer)

0