結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー toyuzukotoyuzuko
提出日時 2020-04-05 20:46:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 629 bytes
コンパイル時間 942 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 77,152 KB
最終ジャッジ日時 2023-09-17 05:32:12
合計ジャッジ時間 9,386 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
76,680 KB
testcase_01 AC 84 ms
76,888 KB
testcase_02 AC 75 ms
76,132 KB
testcase_03 AC 80 ms
76,844 KB
testcase_04 AC 92 ms
76,792 KB
testcase_05 AC 72 ms
76,392 KB
testcase_06 AC 81 ms
76,552 KB
testcase_07 AC 93 ms
76,792 KB
testcase_08 AC 109 ms
76,648 KB
testcase_09 AC 94 ms
76,552 KB
testcase_10 AC 94 ms
76,912 KB
testcase_11 AC 104 ms
76,988 KB
testcase_12 AC 60 ms
71,380 KB
testcase_13 AC 61 ms
71,216 KB
testcase_14 AC 62 ms
71,156 KB
testcase_15 WA -
testcase_16 AC 64 ms
71,148 KB
testcase_17 WA -
testcase_18 AC 98 ms
76,980 KB
testcase_19 AC 90 ms
76,724 KB
testcase_20 AC 98 ms
76,940 KB
testcase_21 AC 77 ms
76,588 KB
testcase_22 AC 81 ms
76,044 KB
testcase_23 AC 69 ms
75,644 KB
testcase_24 AC 70 ms
75,792 KB
testcase_25 AC 74 ms
75,772 KB
testcase_26 AC 71 ms
75,556 KB
testcase_27 AC 67 ms
75,728 KB
testcase_28 AC 73 ms
76,800 KB
testcase_29 AC 73 ms
75,852 KB
testcase_30 AC 70 ms
75,720 KB
testcase_31 AC 70 ms
75,908 KB
testcase_32 AC 69 ms
75,984 KB
testcase_33 AC 96 ms
76,844 KB
testcase_34 AC 99 ms
76,800 KB
testcase_35 AC 95 ms
76,692 KB
testcase_36 AC 86 ms
76,876 KB
testcase_37 AC 102 ms
76,940 KB
testcase_38 AC 82 ms
76,804 KB
testcase_39 AC 102 ms
76,820 KB
testcase_40 AC 103 ms
76,840 KB
testcase_41 AC 109 ms
76,812 KB
testcase_42 AC 96 ms
76,792 KB
testcase_43 AC 102 ms
76,808 KB
testcase_44 AC 80 ms
76,808 KB
testcase_45 AC 100 ms
76,636 KB
testcase_46 AC 81 ms
76,712 KB
testcase_47 AC 82 ms
76,792 KB
testcase_48 AC 94 ms
76,676 KB
testcase_49 AC 90 ms
76,840 KB
testcase_50 AC 93 ms
76,644 KB
testcase_51 AC 90 ms
76,900 KB
testcase_52 AC 91 ms
76,616 KB
testcase_53 AC 111 ms
76,868 KB
testcase_54 AC 90 ms
76,908 KB
testcase_55 AC 78 ms
76,400 KB
testcase_56 AC 102 ms
76,828 KB
testcase_57 AC 90 ms
77,008 KB
testcase_58 AC 62 ms
71,052 KB
testcase_59 AC 61 ms
71,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

INF = 10**18

N = int(input())
S = input()
A = list(map(int, input().split()))
Q = int(input())
K = list(map(int, input().split()))

enemy = [0]

for i in range(N):
    if S[i] == 'E':
        enemy.append(enemy[-1] + 1)
    else:
        enemy.append(enemy[-1])

hp = [0]

for i in range(N):
    hp.append(hp[-1] + A[i])

min_hp = [INF for _ in range(N + 1)]

for i in range(N):
    for j in range(i + 1, N + 1):
        min_hp[enemy[j] - enemy[i]] = min(hp[j] - hp[i], min_hp[enemy[j] - enemy[i]])

for k in range(Q):
    res = 0
    for i in range(N):
        if min_hp[i] <= K[k]:
            res = max(i, res)
    print(res)
0