結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー yansi819yansi819
提出日時 2024-05-12 09:38:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 406 bytes
コンパイル時間 381 ms
コンパイル使用メモリ 82,536 KB
実行使用メモリ 73,420 KB
最終ジャッジ日時 2024-05-12 09:38:50
合計ジャッジ時間 7,789 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
68,200 KB
testcase_01 AC 68 ms
67,168 KB
testcase_02 AC 49 ms
62,564 KB
testcase_03 AC 66 ms
67,456 KB
testcase_04 AC 77 ms
71,168 KB
testcase_05 AC 53 ms
64,080 KB
testcase_06 AC 97 ms
66,544 KB
testcase_07 AC 87 ms
70,284 KB
testcase_08 AC 120 ms
72,868 KB
testcase_09 AC 121 ms
72,588 KB
testcase_10 AC 104 ms
72,872 KB
testcase_11 AC 130 ms
69,700 KB
testcase_12 AC 38 ms
52,388 KB
testcase_13 AC 37 ms
52,516 KB
testcase_14 AC 38 ms
51,820 KB
testcase_15 AC 37 ms
52,680 KB
testcase_16 AC 38 ms
52,864 KB
testcase_17 AC 74 ms
65,976 KB
testcase_18 AC 77 ms
70,976 KB
testcase_19 AC 111 ms
68,924 KB
testcase_20 AC 91 ms
71,884 KB
testcase_21 AC 60 ms
67,128 KB
testcase_22 AC 49 ms
62,252 KB
testcase_23 AC 49 ms
62,464 KB
testcase_24 AC 50 ms
62,832 KB
testcase_25 AC 50 ms
63,956 KB
testcase_26 AC 43 ms
58,796 KB
testcase_27 AC 38 ms
52,672 KB
testcase_28 AC 49 ms
62,696 KB
testcase_29 AC 54 ms
64,352 KB
testcase_30 AC 51 ms
62,348 KB
testcase_31 AC 48 ms
61,800 KB
testcase_32 AC 46 ms
60,144 KB
testcase_33 AC 94 ms
71,780 KB
testcase_34 AC 116 ms
72,036 KB
testcase_35 AC 107 ms
71,776 KB
testcase_36 AC 78 ms
71,084 KB
testcase_37 AC 93 ms
70,144 KB
testcase_38 AC 92 ms
68,360 KB
testcase_39 AC 121 ms
73,092 KB
testcase_40 AC 154 ms
73,420 KB
testcase_41 AC 156 ms
72,944 KB
testcase_42 AC 130 ms
70,280 KB
testcase_43 AC 139 ms
72,260 KB
testcase_44 AC 77 ms
67,960 KB
testcase_45 AC 132 ms
72,116 KB
testcase_46 AC 64 ms
66,176 KB
testcase_47 AC 92 ms
67,072 KB
testcase_48 AC 92 ms
71,636 KB
testcase_49 AC 80 ms
70,156 KB
testcase_50 AC 90 ms
68,324 KB
testcase_51 AC 110 ms
71,696 KB
testcase_52 AC 112 ms
72,444 KB
testcase_53 AC 131 ms
72,868 KB
testcase_54 AC 79 ms
68,788 KB
testcase_55 AC 58 ms
65,780 KB
testcase_56 AC 116 ms
68,612 KB
testcase_57 AC 96 ms
72,476 KB
testcase_58 AC 38 ms
52,332 KB
testcase_59 AC 39 ms
53,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = [0] + [s == "E" for s in input()]
for i in range(1, N + 1):
    S[i] += S[i - 1]
A = [0] + list(map(int, input().split()))
for i in range(1, N + 1):
    A[i] += A[i - 1]
Q = int(input())
K = list(map(int, input().split()))

for k in K:
    l = 0
    ans = 0
    for r in range(N + 1):
        while A[r] - A[l] > k:
            l += 1
        ans = max(ans, S[r] - S[l])
    print(ans)
0