結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,780 KB
testcase_01 AC 15 ms
7,712 KB
testcase_02 AC 15 ms
7,792 KB
testcase_03 AC 16 ms
7,940 KB
testcase_04 AC 15 ms
7,716 KB
testcase_05 AC 16 ms
7,768 KB
testcase_06 AC 16 ms
7,884 KB
testcase_07 AC 83 ms
8,216 KB
testcase_08 AC 16 ms
7,944 KB
testcase_09 AC 19 ms
7,980 KB
testcase_10 AC 21 ms
7,780 KB
testcase_11 AC 383 ms
8,432 KB
testcase_12 AC 374 ms
8,580 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]
			while sum > 777:
				sum = sum - a[left]
				left += 1
			if sum == 777:
				isEnd = True

	return isEnd

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