結果

問題 No.607 開通777年記念
ユーザー shoooooshooooo
提出日時 2019-11-30 13:19:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 903 ms / 2,000 ms
コード長 390 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 10,884 KB
実行使用メモリ 8,500 KB
最終ジャッジ日時 2023-08-13 08:17:38
合計ジャッジ時間 3,075 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,116 KB
testcase_01 AC 16 ms
7,792 KB
testcase_02 AC 16 ms
8,192 KB
testcase_03 AC 15 ms
8,112 KB
testcase_04 AC 15 ms
7,912 KB
testcase_05 AC 15 ms
8,156 KB
testcase_06 AC 16 ms
8,164 KB
testcase_07 AC 49 ms
8,288 KB
testcase_08 AC 16 ms
7,928 KB
testcase_09 AC 25 ms
7,716 KB
testcase_10 AC 16 ms
8,068 KB
testcase_11 AC 814 ms
8,500 KB
testcase_12 AC 903 ms
8,300 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