結果

問題 No.607 開通777年記念
ユーザー KozumaKozuma
提出日時 2018-01-18 23:20:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 420 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 10,932 KB
実行使用メモリ 34,116 KB
最終ジャッジ日時 2023-08-25 21:29:14
合計ジャッジ時間 4,914 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 127 ms
29,524 KB
testcase_02 AC 133 ms
29,556 KB
testcase_03 AC 129 ms
29,684 KB
testcase_04 AC 129 ms
29,724 KB
testcase_05 WA -
testcase_06 AC 127 ms
29,516 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

def densya():
	N, M = map(int, input().split())
	n = np.zeros(N)

	ans = False

	for i in range(M):
		add = np.array(list(map(int, input().split())))
		n = n + add

		for j in range(M):
			sum = 0
			count = 0
			while sum < 777:
				if j + count >= M:
					break
				sum += n[j + count]
				count += 1

				if sum == 777:
					ans = True

	return ans

if densya():
	print("YES")
else:
	print("NO")

0