結果

問題 No.607 開通777年記念
ユーザー KozumaKozuma
提出日時 2018-01-18 23:30:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 426 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 10,900 KB
実行使用メモリ 12,848 KB
最終ジャッジ日時 2023-08-25 21:31:31
合計ジャッジ時間 4,121 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,272 KB
testcase_01 AC 16 ms
7,836 KB
testcase_02 AC 16 ms
7,796 KB
testcase_03 AC 15 ms
7,784 KB
testcase_04 AC 15 ms
7,836 KB
testcase_05 AC 16 ms
7,784 KB
testcase_06 AC 16 ms
7,764 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def densya():
	N, M = map(int, input().split())
	n = [0 for _ in range(N)]

	ans = False

	for i in range(M):
		add = list(map(int, input().split()))
		n = [n[k] + add[k] for k in range(N)]

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

				if sum == 777:
					ans = True

	return ans

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

0