結果

問題 No.1535 五七五
ユーザー 👑 rin204rin204
提出日時 2022-01-18 03:17:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 258 ms / 2,000 ms
コード長 276 bytes
コンパイル時間 431 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 201,508 KB
最終ジャッジ日時 2023-08-15 07:19:14
合計ジャッジ時間 6,631 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,144 KB
testcase_01 AC 72 ms
71,148 KB
testcase_02 AC 73 ms
71,288 KB
testcase_03 AC 70 ms
71,144 KB
testcase_04 AC 214 ms
188,248 KB
testcase_05 AC 258 ms
201,508 KB
testcase_06 AC 246 ms
201,436 KB
testcase_07 AC 72 ms
71,400 KB
testcase_08 AC 70 ms
71,132 KB
testcase_09 AC 73 ms
71,184 KB
testcase_10 AC 71 ms
71,176 KB
testcase_11 AC 73 ms
71,064 KB
testcase_12 AC 73 ms
71,160 KB
testcase_13 AC 72 ms
71,176 KB
testcase_14 AC 71 ms
71,156 KB
testcase_15 AC 73 ms
71,156 KB
testcase_16 AC 82 ms
71,068 KB
testcase_17 AC 72 ms
71,392 KB
testcase_18 AC 255 ms
197,676 KB
testcase_19 AC 253 ms
197,644 KB
testcase_20 AC 247 ms
197,528 KB
testcase_21 AC 250 ms
197,248 KB
testcase_22 AC 249 ms
197,476 KB
testcase_23 AC 250 ms
197,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a, b, c = map(int, input().split())
S = input().split()
S = [len(s) for s in S]
ans = 0
se = {0}
tot = 0
for i in range(n):
    tot += S[i]
    se.add(tot)
    if tot - c in se and tot - c - b in se and tot - c - b - a in se:
        ans += 1
    
print(ans)
0