結果

問題 No.607 開通777年記念
ユーザー KozumaKozuma
提出日時 2018-01-19 16:20:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 408 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 8,668 KB
最終ジャッジ日時 2023-08-25 23:57:47
合計ジャッジ時間 2,169 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,772 KB
testcase_01 AC 16 ms
7,824 KB
testcase_02 AC 16 ms
7,776 KB
testcase_03 AC 15 ms
7,788 KB
testcase_04 AC 16 ms
7,824 KB
testcase_05 WA -
testcase_06 AC 15 ms
7,888 KB
testcase_07 AC 84 ms
8,328 KB
testcase_08 AC 15 ms
7,824 KB
testcase_09 AC 20 ms
7,952 KB
testcase_10 AC 21 ms
7,848 KB
testcase_11 AC 378 ms
8,668 KB
testcase_12 AC 372 ms
8,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

	isEnd = False

	for i in range(M):
		b = list(map(int, input().split()))
		a = [a[j] + b[j] for j in range(N)]
		
		sum = 0
		left = 0
		for right in range(N):
			sum += a[right]
			if sum > 777:
				sum = sum - a[left]
				left += 1
			if sum == 777:
				isEnd = True

	return isEnd
	
if densya():
	print("YES")
else:
	print("NO")
0