結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー stngstng
提出日時 2022-08-15 16:25:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 501 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 82,824 KB
実行使用メモリ 74,800 KB
最終ジャッジ日時 2024-04-10 03:58:55
合計ジャッジ時間 5,722 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
68,880 KB
testcase_01 AC 63 ms
71,208 KB
testcase_02 AC 49 ms
62,992 KB
testcase_03 AC 62 ms
66,968 KB
testcase_04 AC 71 ms
68,392 KB
testcase_05 AC 51 ms
62,592 KB
testcase_06 AC 65 ms
71,384 KB
testcase_07 AC 76 ms
71,600 KB
testcase_08 AC 90 ms
74,800 KB
testcase_09 AC 84 ms
71,824 KB
testcase_10 AC 83 ms
73,056 KB
testcase_11 AC 75 ms
71,308 KB
testcase_12 AC 33 ms
53,636 KB
testcase_13 AC 34 ms
52,880 KB
testcase_14 AC 35 ms
53,652 KB
testcase_15 AC 33 ms
52,316 KB
testcase_16 AC 36 ms
52,904 KB
testcase_17 AC 75 ms
71,196 KB
testcase_18 AC 66 ms
66,412 KB
testcase_19 AC 68 ms
70,944 KB
testcase_20 AC 80 ms
68,820 KB
testcase_21 AC 55 ms
66,564 KB
testcase_22 AC 50 ms
62,688 KB
testcase_23 AC 36 ms
53,460 KB
testcase_24 AC 45 ms
62,196 KB
testcase_25 AC 46 ms
61,240 KB
testcase_26 AC 44 ms
60,888 KB
testcase_27 AC 38 ms
60,152 KB
testcase_28 AC 42 ms
60,824 KB
testcase_29 AC 45 ms
62,464 KB
testcase_30 AC 44 ms
61,984 KB
testcase_31 AC 41 ms
61,380 KB
testcase_32 AC 43 ms
61,828 KB
testcase_33 AC 74 ms
68,960 KB
testcase_34 AC 78 ms
73,856 KB
testcase_35 AC 79 ms
73,628 KB
testcase_36 AC 60 ms
67,192 KB
testcase_37 AC 73 ms
70,468 KB
testcase_38 AC 69 ms
71,788 KB
testcase_39 AC 87 ms
73,928 KB
testcase_40 AC 80 ms
72,908 KB
testcase_41 AC 87 ms
73,308 KB
testcase_42 AC 81 ms
74,636 KB
testcase_43 AC 87 ms
74,160 KB
testcase_44 AC 65 ms
71,956 KB
testcase_45 AC 101 ms
74,288 KB
testcase_46 AC 56 ms
67,308 KB
testcase_47 AC 71 ms
71,268 KB
testcase_48 AC 69 ms
68,512 KB
testcase_49 AC 69 ms
71,416 KB
testcase_50 AC 71 ms
68,532 KB
testcase_51 AC 76 ms
71,976 KB
testcase_52 AC 77 ms
72,596 KB
testcase_53 AC 88 ms
74,712 KB
testcase_54 AC 63 ms
66,812 KB
testcase_55 AC 48 ms
62,444 KB
testcase_56 AC 87 ms
72,888 KB
testcase_57 AC 79 ms
71,988 KB
testcase_58 AC 34 ms
53,448 KB
testcase_59 AC 36 ms
52,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect

n = int(input())
s = input()
a = [int(i) for i in input().split()]
q = int(input())
k = [int(i) for i in input().split()]

dp = [10**15]*(n)

for i in range(n):
    cnt = -1
    val = 0
    for j in range(i,n):
        if s[j] == "E":
            cnt += 1
        val += a[j]
        if cnt == -1:
            continue
        dp[cnt] = min(dp[cnt],val)
        #print(cnt,"cnt")

#print(dp)
#exit()
for i in range(q):
    qry = k[i]
    tmp = bisect.bisect_right(dp,qry)
    print(tmp)
0