結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー Yukino DX.Yukino DX.
提出日時 2023-11-23 22:06:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 266 ms / 2,000 ms
コード長 499 bytes
コンパイル時間 400 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,896 KB
最終ジャッジ日時 2023-11-23 22:06:39
合計ジャッジ時間 11,504 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
76,744 KB
testcase_01 AC 117 ms
76,588 KB
testcase_02 AC 76 ms
72,512 KB
testcase_03 AC 107 ms
76,272 KB
testcase_04 AC 129 ms
76,688 KB
testcase_05 AC 62 ms
68,588 KB
testcase_06 AC 160 ms
76,720 KB
testcase_07 AC 159 ms
76,676 KB
testcase_08 AC 235 ms
76,768 KB
testcase_09 AC 183 ms
76,792 KB
testcase_10 AC 210 ms
76,604 KB
testcase_11 AC 196 ms
76,448 KB
testcase_12 AC 41 ms
53,588 KB
testcase_13 AC 41 ms
53,588 KB
testcase_14 AC 41 ms
53,588 KB
testcase_15 AC 40 ms
53,588 KB
testcase_16 AC 40 ms
53,588 KB
testcase_17 AC 118 ms
76,344 KB
testcase_18 AC 122 ms
76,440 KB
testcase_19 AC 188 ms
76,592 KB
testcase_20 AC 162 ms
76,536 KB
testcase_21 AC 99 ms
76,460 KB
testcase_22 AC 64 ms
68,340 KB
testcase_23 AC 58 ms
66,276 KB
testcase_24 AC 67 ms
70,440 KB
testcase_25 AC 67 ms
70,444 KB
testcase_26 AC 49 ms
62,052 KB
testcase_27 AC 42 ms
55,736 KB
testcase_28 AC 67 ms
70,820 KB
testcase_29 AC 69 ms
70,432 KB
testcase_30 AC 61 ms
68,356 KB
testcase_31 AC 60 ms
68,356 KB
testcase_32 AC 57 ms
66,248 KB
testcase_33 AC 195 ms
76,896 KB
testcase_34 AC 225 ms
76,736 KB
testcase_35 AC 216 ms
76,804 KB
testcase_36 AC 115 ms
76,424 KB
testcase_37 AC 179 ms
76,732 KB
testcase_38 AC 164 ms
76,724 KB
testcase_39 AC 235 ms
76,612 KB
testcase_40 AC 230 ms
76,732 KB
testcase_41 AC 236 ms
76,776 KB
testcase_42 AC 208 ms
76,600 KB
testcase_43 AC 266 ms
76,796 KB
testcase_44 AC 141 ms
76,724 KB
testcase_45 AC 244 ms
76,604 KB
testcase_46 AC 99 ms
76,324 KB
testcase_47 AC 156 ms
76,568 KB
testcase_48 AC 134 ms
76,608 KB
testcase_49 AC 142 ms
76,596 KB
testcase_50 AC 154 ms
76,568 KB
testcase_51 AC 178 ms
76,592 KB
testcase_52 AC 165 ms
76,604 KB
testcase_53 AC 231 ms
76,668 KB
testcase_54 AC 124 ms
76,584 KB
testcase_55 AC 72 ms
72,864 KB
testcase_56 AC 199 ms
76,540 KB
testcase_57 AC 163 ms
76,584 KB
testcase_58 AC 40 ms
55,736 KB
testcase_59 AC 42 ms
55,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

n = int(input())
s = input()
a = list(map(int, input().split()))
q = int(input())
k = list(map(int, input().split()))

for ki in k:
    q = deque()
    sum, cnt, ans = 0, 0, 0
    for i in range(n):
        q.append(i)
        if s[i] == "E":
            cnt += 1
        sum += a[i]

        while sum > ki and q:
            id = q.popleft()
            sum -= a[id]
            if s[id] == "E":
                cnt -= 1

        ans = max(ans, cnt)

    print(ans)
0