結果

問題 No.607 開通777年記念
コンテスト
ユーザー asaka189
提出日時 2018-02-03 22:33:30
言語 Python3
(3.14.3 + numpy 2.4.2 + scipy 1.17.0)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 478 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 546 ms
コンパイル使用メモリ 20,828 KB
実行使用メモリ 68,060 KB
最終ジャッジ日時 2026-03-05 17:41:45
合計ジャッジ時間 9,570 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 5 WA * 4 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n,m = map(int,input().split())
a = []
for i in range(m):
	temp = list(map(int,input().split()))
	a.append(temp)
train = [0 for i in range(n)]
check = False

for i in range(m):
	for k in range(n):
		train[k] += a[i][k]
	if sum(train) == 777:
		check = True
	e = 0
	while e<n:
		temptotal = 0
		f = 0
		while temptotal < 777 and (e+f)!= n:
			temptotal += train[e+f]
			f += 1
		if temptotal == 777:
			check = True
			break
		e += 1	
	
if check:
	print('YES')
else:
	print('No')
0