結果

問題 No.607 開通777年記念
ユーザー pluto77pluto77
提出日時 2017-12-30 15:55:11
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 489 bytes
コンパイル時間 810 ms
コンパイル使用メモリ 6,676 KB
実行使用メモリ 38,724 KB
最終ジャッジ日時 2023-08-23 11:02:45
合計ジャッジ時間 5,446 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 11 ms
6,028 KB
testcase_02 WA -
testcase_03 AC 11 ms
5,976 KB
testcase_04 AC 11 ms
5,932 KB
testcase_05 AC 11 ms
5,856 KB
testcase_06 AC 11 ms
5,868 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki_607
import sys

n,m=map(int,raw_input().split())
a=[]
for i in xrange(m):
 b=map(int,raw_input().split())
 a.append(b)
c=a[0]
l,r=0,1
for i in range(n*2):
 s=sum(c[l:r])
 if s==777:
  print 'YES'
  exit()
 elif s<777:
  r+=1
 else:
  l+=1
 if r>n:
  continue
for i in xrange(1,m):
 for j in xrange(n):
  c[j]+=a[i][j]
 print c
 l,r=0,1
 for i in range(n*2):
  s=sum(c[l:r])
  if s==777:
   print 'YES'
   exit()
  elif s<777:
   r+=1
  else:
   l+=1
  if r>n:
   continue
print 'NO'
0