結果

問題 No.607 開通777年記念
ユーザー MaboyMaboy
提出日時 2018-03-07 18:27:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 566 ms / 2,000 ms
コード長 306 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 51,072 KB
最終ジャッジ日時 2024-04-14 06:17:12
合計ジャッジ時間 3,439 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 32 ms
10,752 KB
testcase_04 AC 31 ms
10,752 KB
testcase_05 AC 31 ms
10,752 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 101 ms
13,056 KB
testcase_08 AC 31 ms
10,752 KB
testcase_09 AC 36 ms
11,136 KB
testcase_10 AC 34 ms
11,264 KB
testcase_11 AC 547 ms
50,944 KB
testcase_12 AC 566 ms
51,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def w(l):
  s,b,g=0,0,777
  for a in range(n):
    while b<n and s<g:
      s+=l[b]
      b+=1
    if s==777:return 1
    s-=l[a]
n,m=map(int,input().split())
a=[list(map(int,input().split())) for i in'.'*m]
v,b='NO',[0]*n
for i in a:
  b=[a+b for a,b in zip(b,i)]
  if w(b):
    v='YES'
    break
print(v)
0