結果

問題 No.1535 五七五
ユーザー 👑 H20H20
提出日時 2021-06-15 11:04:47
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 776 bytes
コンパイル時間 526 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 157,820 KB
最終ジャッジ日時 2023-08-27 01:28:46
合計ジャッジ時間 6,122 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
75,908 KB
testcase_01 AC 73 ms
71,436 KB
testcase_02 AC 72 ms
71,416 KB
testcase_03 AC 73 ms
71,264 KB
testcase_04 AC 186 ms
143,368 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A,B,C = map(int,input().split())
SS = input().split()
L = []
for s in SS:
    L.append(len(s))


ans=0
for i in range(N+1):
    f=0
    j=i
    while j<N and f<A:
        f += L[j]
        j += 1
    if f==A:
        s=0
        l=j
        for k in range(j,N+1):
            while l<N and s<B:
                s += L[l]
                l += 1
            if s==B:
                t=0
                n=l
                for m in range(l,N+1):
                    while n<N and t<C:
                        t+=L[n]
                        n+=1
                    if t==C:
                        ans+=1
                    if m==N or t==C:
                        break
            if k==N or s==B:
                break
    if i==N:
        break
print(ans)
0