結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー rkyiolklorkyiolklo
提出日時 2020-05-03 20:18:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 790 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 353 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 78,432 KB
最終ジャッジ日時 2023-09-04 20:50:56
合計ジャッジ時間 21,737 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
77,768 KB
testcase_01 AC 236 ms
77,844 KB
testcase_02 AC 106 ms
77,172 KB
testcase_03 AC 266 ms
77,272 KB
testcase_04 AC 310 ms
77,948 KB
testcase_05 AC 109 ms
76,784 KB
testcase_06 AC 409 ms
77,480 KB
testcase_07 AC 388 ms
77,756 KB
testcase_08 AC 790 ms
78,220 KB
testcase_09 AC 513 ms
78,208 KB
testcase_10 AC 605 ms
77,908 KB
testcase_11 AC 725 ms
77,944 KB
testcase_12 AC 74 ms
71,400 KB
testcase_13 AC 75 ms
71,300 KB
testcase_14 AC 76 ms
71,512 KB
testcase_15 AC 73 ms
71,112 KB
testcase_16 AC 72 ms
71,412 KB
testcase_17 AC 472 ms
78,076 KB
testcase_18 AC 239 ms
77,720 KB
testcase_19 AC 450 ms
78,344 KB
testcase_20 AC 357 ms
77,872 KB
testcase_21 AC 127 ms
77,688 KB
testcase_22 AC 99 ms
76,768 KB
testcase_23 AC 90 ms
76,388 KB
testcase_24 AC 92 ms
76,900 KB
testcase_25 AC 92 ms
77,060 KB
testcase_26 AC 85 ms
76,552 KB
testcase_27 AC 79 ms
75,500 KB
testcase_28 AC 91 ms
76,756 KB
testcase_29 AC 96 ms
77,084 KB
testcase_30 AC 90 ms
76,416 KB
testcase_31 AC 90 ms
76,580 KB
testcase_32 AC 93 ms
76,764 KB
testcase_33 AC 394 ms
77,808 KB
testcase_34 AC 627 ms
77,752 KB
testcase_35 AC 561 ms
78,136 KB
testcase_36 AC 206 ms
77,724 KB
testcase_37 AC 393 ms
77,936 KB
testcase_38 AC 398 ms
77,712 KB
testcase_39 AC 670 ms
77,976 KB
testcase_40 AC 703 ms
78,044 KB
testcase_41 AC 704 ms
77,988 KB
testcase_42 AC 568 ms
78,136 KB
testcase_43 AC 722 ms
77,964 KB
testcase_44 AC 299 ms
77,732 KB
testcase_45 AC 739 ms
78,312 KB
testcase_46 AC 157 ms
77,444 KB
testcase_47 AC 339 ms
77,540 KB
testcase_48 AC 288 ms
77,688 KB
testcase_49 AC 315 ms
78,088 KB
testcase_50 AC 371 ms
77,780 KB
testcase_51 AC 435 ms
78,084 KB
testcase_52 AC 426 ms
77,824 KB
testcase_53 AC 641 ms
78,432 KB
testcase_54 AC 211 ms
77,648 KB
testcase_55 AC 112 ms
77,400 KB
testcase_56 AC 506 ms
77,848 KB
testcase_57 AC 373 ms
77,628 KB
testcase_58 AC 74 ms
71,172 KB
testcase_59 AC 72 ms
71,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
N = int(input())
S = input()
A = [int(a) for a in input().split()]
Q = int(input())
K = [int(k) for k in input().split()]

for i in range(N-1):
    A[i+1] += A[i]
A = [0] + A

enemy = [0]*(N+1)
for i in range(N):
    if S[i] == "E":
        enemy[i+1] = 1
    enemy[i+1] += enemy[i]

for k in K:
    ans = 0
    for i in range(N):
        idx = bisect.bisect_right(A, k+A[i])
        ans = max(ans, enemy[idx-1]-enemy[i])
    print(ans)
0