結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 15 ms
7,748 KB
testcase_02 AC 15 ms
7,740 KB
testcase_03 AC 15 ms
7,892 KB
testcase_04 AC 15 ms
7,832 KB
testcase_05 WA -
testcase_06 AC 15 ms
7,904 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 i in range(M)]

	ans = False

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

		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