結果
問題 | No.1535 五七五 |
ユーザー |
![]() |
提出日時 | 2021-06-15 11:04:47 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 776 bytes |
コンパイル時間 | 339 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 203,972 KB |
最終ジャッジ日時 | 2024-12-26 05:57:56 |
合計ジャッジ時間 | 24,790 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 TLE * 7 |
ソースコード
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)