結果

問題 No.1535 五七五
ユーザー lloyzlloyz
提出日時 2021-12-22 22:31:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 484 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 10,928 KB
実行使用メモリ 53,256 KB
最終ジャッジ日時 2023-10-15 00:22:59
合計ジャッジ時間 6,129 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,956 KB
testcase_01 AC 16 ms
7,780 KB
testcase_02 AC 16 ms
7,772 KB
testcase_03 AC 16 ms
7,968 KB
testcase_04 AC 810 ms
17,812 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())
ABC = list(map(int, input().split()))
S = list(input().split())

Slen = [0 for _ in range(n)]
for i in range(n):
    Slen[i] = len(S[i])

ans = 0
for i in range(n):
    ind = 0
    tmp = 0
    while i < n:
        tmp += Slen[i]
        if tmp == ABC[ind]:
            ind += 1
            if ind == 3:
                ans += 1
                break
            tmp = 0
        elif tmp > ABC[ind]:
            break
        i += 1
print(ans)
0