結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー maspymaspy
提出日時 2020-02-02 15:43:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 734 bytes
コンパイル時間 251 ms
コンパイル使用メモリ 12,052 KB
実行使用メモリ 42,424 KB
最終ジャッジ日時 2023-10-19 00:58:37
合計ジャッジ時間 41,393 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 609 ms
42,420 KB
testcase_07 WA -
testcase_08 AC 927 ms
42,420 KB
testcase_09 AC 733 ms
42,420 KB
testcase_10 AC 737 ms
42,420 KB
testcase_11 WA -
testcase_12 AC 490 ms
42,420 KB
testcase_13 AC 491 ms
42,420 KB
testcase_14 AC 494 ms
42,424 KB
testcase_15 WA -
testcase_16 AC 486 ms
42,424 KB
testcase_17 AC 887 ms
42,424 KB
testcase_18 AC 740 ms
42,424 KB
testcase_19 AC 598 ms
42,424 KB
testcase_20 AC 820 ms
42,424 KB
testcase_21 AC 496 ms
42,424 KB
testcase_22 AC 572 ms
42,424 KB
testcase_23 WA -
testcase_24 AC 494 ms
42,424 KB
testcase_25 AC 493 ms
42,424 KB
testcase_26 AC 491 ms
42,424 KB
testcase_27 AC 486 ms
42,424 KB
testcase_28 WA -
testcase_29 AC 491 ms
42,424 KB
testcase_30 AC 494 ms
42,424 KB
testcase_31 AC 504 ms
42,424 KB
testcase_32 AC 493 ms
42,424 KB
testcase_33 AC 868 ms
42,424 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 620 ms
42,424 KB
testcase_37 AC 808 ms
42,424 KB
testcase_38 AC 599 ms
42,424 KB
testcase_39 WA -
testcase_40 AC 794 ms
42,424 KB
testcase_41 AC 798 ms
42,424 KB
testcase_42 AC 826 ms
42,424 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 569 ms
42,424 KB
testcase_48 AC 741 ms
42,424 KB
testcase_49 AC 579 ms
42,424 KB
testcase_50 AC 722 ms
42,424 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 918 ms
42,424 KB
testcase_54 AC 665 ms
42,424 KB
testcase_55 AC 494 ms
42,424 KB
testcase_56 WA -
testcase_57 WA -
testcase_58 AC 486 ms
42,424 KB
testcase_59 AC 486 ms
42,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
S = np.frombuffer(readline().rstrip(),'S1') == b'E'
A = np.array(readline().split(),np.int64)
Q = int(readline())
K = np.array(read().split(),np.int64)

INF = 10 ** 18
min_power = [INF] * (N+1)

for L in range(N):
    power = A[L:].cumsum()
    n_enemy = np.cumsum(S[L:])
    for p,n in zip(power.tolist(), n_enemy.tolist()):
        if min_power[n] > p:
            min_power[n] = p

for n in range(N-1,-1,-1):
    if min_power[n] > min_power[n+1]:
        min_power[n] = min_power[n+1]

answer = np.searchsorted(min_power, K, 'right') - 1
print('\n'.join(answer.astype(str)))
0