結果

問題 No.607 開通777年記念
ユーザー marcypymarcypy
提出日時 2021-05-27 06:56:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 518 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 82,136 KB
実行使用メモリ 93,944 KB
最終ジャッジ日時 2024-04-23 21:17:12
合計ジャッジ時間 2,242 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
54,480 KB
testcase_01 AC 40 ms
54,384 KB
testcase_02 AC 42 ms
54,120 KB
testcase_03 AC 43 ms
53,828 KB
testcase_04 AC 41 ms
54,712 KB
testcase_05 WA -
testcase_06 AC 45 ms
54,688 KB
testcase_07 AC 84 ms
78,184 KB
testcase_08 AC 46 ms
54,372 KB
testcase_09 AC 61 ms
67,352 KB
testcase_10 AC 50 ms
63,604 KB
testcase_11 AC 165 ms
93,944 KB
testcase_12 AC 156 ms
93,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
import sys
n,m=map(int,input().split())
a=[list(map(int,input().split()))for _ in range(m)]

rs=[[0]*n for _ in range(m+1)]
for i in range(m):
    for j in range(n):
        rs[i+1][j]=rs[i][j]+a[i][j]
#print(rs)
for r in rs[1:]:
    #print(r)
    t=0
    q=deque()
    for v in r:
        q.append(v)
        t+=v
        #print(t)
        if t==777:
            print('YES')
            sys.exit()
        while q and t>777:
            rm=q.popleft()
            t-=rm
    
print('NO')
0