結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー tcltktcltk
提出日時 2021-01-16 10:33:30
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,139 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 97,984 KB
最終ジャッジ日時 2023-08-18 06:56:09
合計ジャッジ時間 11,618 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 293 ms
87,580 KB
testcase_01 AC 278 ms
86,776 KB
testcase_02 AC 253 ms
86,304 KB
testcase_03 AC 274 ms
87,376 KB
testcase_04 AC 282 ms
87,640 KB
testcase_05 AC 259 ms
86,672 KB
testcase_06 AC 394 ms
87,060 KB
testcase_07 AC 379 ms
87,468 KB
testcase_08 AC 522 ms
87,776 KB
testcase_09 AC 423 ms
87,336 KB
testcase_10 AC 460 ms
87,376 KB
testcase_11 AC 555 ms
88,124 KB
testcase_12 AC 245 ms
83,404 KB
testcase_13 AC 240 ms
83,024 KB
testcase_14 AC 246 ms
82,888 KB
testcase_15 AC 241 ms
83,408 KB
testcase_16 AC 238 ms
83,096 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#region Header
#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
from queue import PriorityQueue
import bisect
import heapq

def input():
    return sys.stdin.readline()[:-1]

sys.setrecursionlimit(1000000)
#endregion

# _INPUT = """10
# EEEEEEEEEE
# 1 2 3 4 5 6 7 8 9 10
# 10
# 1 2 3 4 5 6 7 8 9 10
# """
# sys.stdin = io.StringIO(_INPUT)



def main():
    N = int(input())
    S = input()
    A = list(map(int, input().split()))
    Q = int(input())
    K = list(map(int, input().split()))

    # T[i] := A[0]~A[i-1] を倒すのに必要な威力(累積和)
    T = [0]
    for i in range(N):
        T.append(T[-1] + A[i])

    for power in K:
        score = 0
        r = 0
        for l in range(N):
            while r < N and T[r+1] - T[l] <= power:
                r += 1
            score1 = len([1 for i in range(l, r) if S[i] == 'E'])
            score = max(score, score1)

            if r == l:
                r += 1
        print(score)

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