結果

問題 No.1535 五七五
ユーザー 👑 H20H20
提出日時 2021-06-15 11:04:47
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 776 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 157,380 KB
最終ジャッジ日時 2024-06-07 20:44:39
合計ジャッジ時間 5,092 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
57,216 KB
testcase_01 AC 38 ms
51,584 KB
testcase_02 AC 35 ms
51,840 KB
testcase_03 AC 40 ms
51,328 KB
testcase_04 AC 162 ms
139,584 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