結果

問題 No.607 開通777年記念
ユーザー shoooooshooooo
提出日時 2019-11-30 13:19:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,067 ms / 2,000 ms
コード長 390 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-05-01 01:57:50
合計ジャッジ時間 3,376 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,880 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 31 ms
10,752 KB
testcase_04 AC 31 ms
10,752 KB
testcase_05 AC 31 ms
10,880 KB
testcase_06 AC 30 ms
10,752 KB
testcase_07 AC 66 ms
10,880 KB
testcase_08 AC 30 ms
10,752 KB
testcase_09 AC 43 ms
10,880 KB
testcase_10 AC 30 ms
10,752 KB
testcase_11 AC 948 ms
11,136 KB
testcase_12 AC 1,067 ms
11,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
N,M=map(int,input().split())
table=[0]*N
for k in range(M):
  V=0
  a=list(map(int,input().split()))
  j=0
  for i in range(N):
    table[i]+=a[i]
    V+=table[i]
    if V<777:
      pass
    elif V==777:
      print('YES')
      sys.exit()
    else:
      while j<i and V>777:
        V-=table[j]
        j+=1
      if V==777:
        print('YES')
        sys.exit()
print('NO')
0