結果

問題 No.607 開通777年記念
ユーザー DrDrpilotDrDrpilot
提出日時 2022-01-21 14:00:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 603 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 8,968 KB
最終ジャッジ日時 2023-08-16 19:15:39
合計ジャッジ時間 3,225 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,512 KB
testcase_01 AC 17 ms
8,600 KB
testcase_02 AC 17 ms
8,508 KB
testcase_03 WA -
testcase_04 AC 16 ms
8,600 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 70 ms
8,596 KB
testcase_08 AC 17 ms
8,516 KB
testcase_09 AC 26 ms
8,684 KB
testcase_10 AC 17 ms
8,672 KB
testcase_11 AC 796 ms
8,968 KB
testcase_12 AC 923 ms
8,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
n,m=map(int,input().split())
for i in range(m):
    if i==0:
        l=list(map(int,input().split()))
    else:
        tmp=list(map(int,input().split()))
        for i in range(n):
            l[i]+=tmp[i]
            if tmp[i]==777:
                print('YES')
                exit()
        q=deque()
        now=0
        for i in range(n):
            now+=l[i]
            q.append(l[i])
            while now>777 and q:
                out=q.popleft()
                now-=out
            if now==777:
                print('YES')
                exit()
print('NO')
0