結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー 👑 H20H20
提出日時 2021-02-03 10:23:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 536 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 86,812 KB
実行使用メモリ 77,276 KB
最終ジャッジ日時 2023-09-12 11:46:34
合計ジャッジ時間 9,400 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
76,692 KB
testcase_01 AC 96 ms
76,756 KB
testcase_02 AC 82 ms
76,196 KB
testcase_03 AC 96 ms
76,648 KB
testcase_04 AC 104 ms
76,564 KB
testcase_05 AC 84 ms
76,264 KB
testcase_06 AC 98 ms
76,888 KB
testcase_07 AC 105 ms
76,916 KB
testcase_08 AC 127 ms
76,896 KB
testcase_09 AC 112 ms
76,820 KB
testcase_10 AC 115 ms
76,856 KB
testcase_11 AC 125 ms
77,112 KB
testcase_12 AC 73 ms
71,352 KB
testcase_13 AC 73 ms
71,052 KB
testcase_14 AC 73 ms
71,272 KB
testcase_15 AC 72 ms
71,268 KB
testcase_16 AC 74 ms
71,372 KB
testcase_17 AC 128 ms
76,912 KB
testcase_18 AC 106 ms
76,540 KB
testcase_19 AC 99 ms
76,752 KB
testcase_20 AC 116 ms
76,768 KB
testcase_21 AC 86 ms
76,360 KB
testcase_22 AC 84 ms
76,280 KB
testcase_23 AC 78 ms
75,172 KB
testcase_24 AC 80 ms
75,728 KB
testcase_25 AC 81 ms
75,724 KB
testcase_26 AC 80 ms
75,792 KB
testcase_27 AC 77 ms
75,540 KB
testcase_28 AC 80 ms
75,796 KB
testcase_29 AC 80 ms
75,880 KB
testcase_30 AC 81 ms
75,828 KB
testcase_31 AC 79 ms
75,924 KB
testcase_32 AC 79 ms
75,896 KB
testcase_33 AC 119 ms
76,612 KB
testcase_34 AC 116 ms
76,880 KB
testcase_35 AC 118 ms
76,824 KB
testcase_36 AC 98 ms
76,756 KB
testcase_37 AC 113 ms
76,636 KB
testcase_38 AC 100 ms
76,748 KB
testcase_39 AC 117 ms
76,944 KB
testcase_40 AC 119 ms
76,856 KB
testcase_41 AC 120 ms
76,888 KB
testcase_42 AC 121 ms
76,864 KB
testcase_43 AC 120 ms
76,864 KB
testcase_44 AC 97 ms
76,788 KB
testcase_45 AC 130 ms
76,976 KB
testcase_46 AC 93 ms
76,696 KB
testcase_47 AC 99 ms
76,776 KB
testcase_48 AC 107 ms
76,572 KB
testcase_49 AC 97 ms
77,004 KB
testcase_50 AC 108 ms
76,616 KB
testcase_51 AC 113 ms
77,024 KB
testcase_52 AC 111 ms
76,908 KB
testcase_53 AC 131 ms
76,872 KB
testcase_54 AC 99 ms
76,612 KB
testcase_55 AC 83 ms
76,324 KB
testcase_56 AC 118 ms
77,276 KB
testcase_57 AC 108 ms
76,892 KB
testcase_58 AC 72 ms
71,280 KB
testcase_59 AC 72 ms
71,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import itertools
E = [10**9]*2001
E[0] = 0
N = int(input())
S = input()
L=[]
for i in range(N):
    if S[i]=='E':
        L.append(1)
    else:
        L.append(0)
A = list(map(int,input().split()))
EC = list(itertools.accumulate(L))+[0]
AC = list(itertools.accumulate(A))+[0]
for i in range(N):
    for j in range(i,N):
        e = EC[j] - EC[i-1]
        a = AC[j] - AC[i-1]
        E[e] = min(E[e],a)



Q = int(input())
K = list(map(int,input().split()))
for i in range(Q):
    print( bisect.bisect_right(E, K[i]) - 1)
0