結果

問題 No.1535 五七五
ユーザー titiatitia
提出日時 2021-06-06 18:45:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,527 ms / 2,000 ms
コード長 377 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 10,872 KB
実行使用メモリ 50,760 KB
最終ジャッジ日時 2023-08-15 01:07:04
合計ジャッジ時間 14,061 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,084 KB
testcase_01 AC 17 ms
8,300 KB
testcase_02 AC 17 ms
8,148 KB
testcase_03 AC 16 ms
8,144 KB
testcase_04 AC 1,527 ms
35,568 KB
testcase_05 AC 1,435 ms
49,048 KB
testcase_06 AC 1,516 ms
49,100 KB
testcase_07 AC 17 ms
8,112 KB
testcase_08 AC 17 ms
8,324 KB
testcase_09 AC 17 ms
8,260 KB
testcase_10 AC 17 ms
8,248 KB
testcase_11 AC 18 ms
8,084 KB
testcase_12 AC 17 ms
8,084 KB
testcase_13 AC 17 ms
8,160 KB
testcase_14 AC 17 ms
8,252 KB
testcase_15 AC 18 ms
8,256 KB
testcase_16 AC 17 ms
8,304 KB
testcase_17 AC 17 ms
8,156 KB
testcase_18 AC 1,261 ms
50,564 KB
testcase_19 AC 1,267 ms
47,860 KB
testcase_20 AC 1,263 ms
47,816 KB
testcase_21 AC 1,271 ms
50,756 KB
testcase_22 AC 1,260 ms
50,760 KB
testcase_23 AC 1,322 ms
50,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate
import bisect

N=int(input())
a,b,c=map(int,input().split())
S=input().split()
S=[len(s) for s in S]
A=[0]+list(accumulate(S))

ANS=0

for i in range(N):
    x=A[i]

    y=bisect.bisect(A,x+a)
    z=bisect.bisect(A,x+a+b)
    w=bisect.bisect(A,x+a+b+c)



    if A[y-1]==x+a and A[z-1]==x+a+b and A[w-1]==x+a+b+c:
        ANS+=1
    
print(ANS)
0