結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー tails1434tails1434
提出日時 2019-12-23 21:26:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 648 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 81,632 KB
実行使用メモリ 74,680 KB
最終ジャッジ日時 2023-10-19 04:18:19
合計ジャッジ時間 6,774 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 67 ms
68,512 KB
testcase_07 WA -
testcase_08 AC 99 ms
73,152 KB
testcase_09 AC 76 ms
70,724 KB
testcase_10 AC 77 ms
72,780 KB
testcase_11 WA -
testcase_12 AC 39 ms
53,288 KB
testcase_13 AC 41 ms
53,288 KB
testcase_14 AC 41 ms
53,288 KB
testcase_15 WA -
testcase_16 AC 40 ms
53,288 KB
testcase_17 AC 90 ms
70,792 KB
testcase_18 AC 78 ms
68,308 KB
testcase_19 AC 73 ms
70,568 KB
testcase_20 AC 73 ms
68,304 KB
testcase_21 AC 56 ms
63,792 KB
testcase_22 AC 53 ms
61,576 KB
testcase_23 WA -
testcase_24 AC 49 ms
61,364 KB
testcase_25 AC 45 ms
59,312 KB
testcase_26 AC 46 ms
59,312 KB
testcase_27 AC 45 ms
59,296 KB
testcase_28 WA -
testcase_29 AC 48 ms
61,560 KB
testcase_30 AC 47 ms
59,312 KB
testcase_31 AC 45 ms
59,296 KB
testcase_32 AC 47 ms
59,312 KB
testcase_33 AC 74 ms
68,312 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 60 ms
64,116 KB
testcase_37 AC 84 ms
68,384 KB
testcase_38 AC 68 ms
68,520 KB
testcase_39 WA -
testcase_40 AC 91 ms
72,872 KB
testcase_41 AC 94 ms
72,872 KB
testcase_42 AC 83 ms
72,864 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 68 ms
70,576 KB
testcase_48 AC 66 ms
66,176 KB
testcase_49 AC 72 ms
68,520 KB
testcase_50 AC 72 ms
68,292 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 102 ms
74,680 KB
testcase_54 AC 71 ms
66,264 KB
testcase_55 AC 50 ms
61,588 KB
testcase_56 WA -
testcase_57 WA -
testcase_58 AC 39 ms
53,288 KB
testcase_59 AC 39 ms
53,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate
from bisect import bisect_right

def main():
    N = int(input())
    S = input()
    A = list(map(int, input().split()))
    Q = int(input())
    K = list(map(int, input().split()))
    B = [0] + list(accumulate(A))
    C = [0] * (N + 1)
    for i in range(N):
        if S[i] == 'E':
            C[i+1] = C[i] + 1
        else:
            C[i+1] = C[i]

    P = [float('inf')] * (max(C) + 1)
    for i in range(N+1):
        for j in range(i+1,N+1):
            P[C[j]-C[i]] = min(P[C[j]-C[i]], B[j]-B[i])
    for k in K:
        d = bisect_right(P,k)
        print(d-1) 



if __name__ == "__main__":
    main()
0