結果

問題 No.2693 Sword
ユーザー tkykwtnbtkykwtnb
提出日時 2024-03-23 07:35:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 295 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 9,984 KB
最終ジャッジ日時 2024-03-23 07:35:51
合計ジャッジ時間 2,856 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
9,856 KB
testcase_01 AC 31 ms
9,856 KB
testcase_02 AC 32 ms
9,856 KB
testcase_03 AC 30 ms
9,856 KB
testcase_04 AC 30 ms
9,856 KB
testcase_05 AC 31 ms
9,856 KB
testcase_06 AC 31 ms
9,856 KB
testcase_07 AC 31 ms
9,856 KB
testcase_08 AC 33 ms
9,856 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 31 ms
9,856 KB
testcase_15 AC 64 ms
9,984 KB
testcase_16 WA -
testcase_17 AC 96 ms
9,984 KB
testcase_18 AC 49 ms
9,984 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 32 ms
9,856 KB
testcase_25 AC 31 ms
9,856 KB
testcase_26 AC 31 ms
9,856 KB
testcase_27 AC 31 ms
9,856 KB
testcase_28 AC 30 ms
9,856 KB
testcase_29 AC 31 ms
9,856 KB
testcase_30 AC 31 ms
9,856 KB
testcase_31 AC 32 ms
9,856 KB
testcase_32 AC 34 ms
9,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,P,K=map(int,input().split())
T=[]
B=[]
for _ in range(N):
    t,b=map(int,input().split())
    T.append(t)
    B.append(b)
ans=0
for i in range(N-K+1):
    tmp=P
    for k in range(K):
        if T[i+k]==1:tmp+=B[i+k]
        else:tmp*=2
    ans=max(ans,tmp)
print(ans if ans<=10**18 else -1)
0