結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー ptotqptotq
提出日時 2019-11-29 22:36:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 929 ms / 2,000 ms
コード長 640 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,280 KB
実行使用メモリ 94,692 KB
最終ジャッジ日時 2023-10-12 06:29:45
合計ジャッジ時間 14,988 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
78,176 KB
testcase_01 AC 150 ms
77,896 KB
testcase_02 AC 107 ms
77,740 KB
testcase_03 AC 156 ms
78,356 KB
testcase_04 AC 186 ms
79,324 KB
testcase_05 AC 106 ms
78,148 KB
testcase_06 AC 206 ms
78,812 KB
testcase_07 AC 207 ms
79,128 KB
testcase_08 AC 388 ms
81,640 KB
testcase_09 AC 267 ms
80,108 KB
testcase_10 AC 299 ms
80,364 KB
testcase_11 AC 792 ms
92,152 KB
testcase_12 AC 79 ms
71,136 KB
testcase_13 AC 79 ms
71,136 KB
testcase_14 AC 78 ms
71,132 KB
testcase_15 AC 79 ms
71,336 KB
testcase_16 AC 79 ms
71,136 KB
testcase_17 AC 929 ms
94,692 KB
testcase_18 AC 174 ms
79,948 KB
testcase_19 AC 239 ms
78,588 KB
testcase_20 AC 227 ms
80,672 KB
testcase_21 AC 113 ms
77,292 KB
testcase_22 AC 104 ms
78,048 KB
testcase_23 AC 90 ms
76,248 KB
testcase_24 AC 92 ms
76,444 KB
testcase_25 AC 94 ms
76,400 KB
testcase_26 AC 89 ms
76,316 KB
testcase_27 AC 85 ms
75,984 KB
testcase_28 AC 94 ms
76,336 KB
testcase_29 AC 99 ms
77,080 KB
testcase_30 AC 96 ms
76,432 KB
testcase_31 AC 91 ms
76,512 KB
testcase_32 AC 94 ms
76,280 KB
testcase_33 AC 249 ms
81,196 KB
testcase_34 AC 322 ms
80,576 KB
testcase_35 AC 281 ms
80,064 KB
testcase_36 AC 143 ms
78,948 KB
testcase_37 AC 245 ms
80,872 KB
testcase_38 AC 209 ms
78,928 KB
testcase_39 AC 315 ms
80,468 KB
testcase_40 AC 324 ms
80,372 KB
testcase_41 AC 350 ms
80,872 KB
testcase_42 AC 315 ms
81,092 KB
testcase_43 AC 325 ms
80,860 KB
testcase_44 AC 164 ms
78,004 KB
testcase_45 AC 366 ms
82,036 KB
testcase_46 AC 116 ms
77,428 KB
testcase_47 AC 185 ms
78,360 KB
testcase_48 AC 181 ms
79,660 KB
testcase_49 AC 178 ms
78,804 KB
testcase_50 AC 223 ms
79,972 KB
testcase_51 AC 231 ms
79,536 KB
testcase_52 AC 229 ms
79,452 KB
testcase_53 AC 349 ms
81,972 KB
testcase_54 AC 151 ms
79,428 KB
testcase_55 AC 109 ms
77,096 KB
testcase_56 AC 257 ms
80,184 KB
testcase_57 AC 190 ms
79,456 KB
testcase_58 AC 75 ms
71,260 KB
testcase_59 AC 74 ms
71,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_right
N = int(input())
S = input()
hp = list(map(int, input().split()))
enemy_count = S.count('E')
enemy_pos = [-1]

for i in range(N):
    if S[i] == 'E':
        enemy_pos.append(i)

accs = [[] for _ in range(enemy_count+1)]

for i in range(1, enemy_count+1):
    power = 0
    for j in range(enemy_pos[i], N):
        power += hp[j]
        if S[j] == 'E':
            accs[i].append(power)


Q = int(input())
ans_a = []
for power in map(int, input().split()):
    ans = 0
    for i in range(1, enemy_count+1):
        ans = max(ans, bisect_right(accs[i], power))
    ans_a.append(ans)

print(*ans_a, sep='\n')
0