結果

問題 No.607 開通777年記念
ユーザー takakintakakin
提出日時 2020-05-24 21:45:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 978 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-20 12:56:39
合計ジャッジ時間 3,703 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,624 KB
testcase_01 AC 27 ms
10,752 KB
testcase_02 AC 26 ms
10,752 KB
testcase_03 AC 26 ms
10,752 KB
testcase_04 AC 27 ms
10,880 KB
testcase_05 AC 26 ms
10,752 KB
testcase_06 AC 26 ms
10,752 KB
testcase_07 AC 164 ms
10,880 KB
testcase_08 AC 25 ms
10,880 KB
testcase_09 AC 34 ms
10,880 KB
testcase_10 AC 34 ms
10,752 KB
testcase_11 AC 964 ms
11,008 KB
testcase_12 AC 978 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n,m=map(int,input().split())
T=[0]*n
ans=False
for _ in range(m):
  A=[int(i) for i in input().split()]
  for i in range(n):
    T[i]+=A[i]
  l,r=0,1
  tot=T[0]
  while True:
    if tot>777:
      tot-=T[l]
      l+=1
    elif tot<777:
      if r==n:
        break
      else:
        tot+=T[r]
        r+=1
    else:
      ans=True
      break
  else:
    continue
print("YES" if ans else "NO")
0