結果

問題 No.430 文字列検索
ユーザー matsu7874matsu7874
提出日時 2016-10-02 23:54:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 338 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 1,776 ms
コンパイル使用メモリ 86,788 KB
実行使用メモリ 176,796 KB
最終ジャッジ日時 2023-08-15 17:31:33
合計ジャッジ時間 4,445 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,712 KB
testcase_01 AC 338 ms
176,796 KB
testcase_02 AC 160 ms
78,100 KB
testcase_03 AC 161 ms
78,340 KB
testcase_04 AC 94 ms
71,784 KB
testcase_05 AC 95 ms
71,796 KB
testcase_06 AC 93 ms
71,760 KB
testcase_07 AC 94 ms
71,880 KB
testcase_08 AC 248 ms
153,400 KB
testcase_09 AC 94 ms
71,888 KB
testcase_10 AC 116 ms
84,700 KB
testcase_11 AC 202 ms
96,668 KB
testcase_12 AC 200 ms
96,692 KB
testcase_13 AC 200 ms
96,712 KB
testcase_14 AC 187 ms
88,368 KB
testcase_15 AC 178 ms
83,112 KB
testcase_16 AC 167 ms
78,128 KB
testcase_17 AC 160 ms
78,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
text = input()
len_text = len(text)
dic = collections.defaultdict(int)
for i in range(1,11):
    for j in range(len_text-i+1):
        dic[text[j:j+i]] += 1
total = 0
m = int(input())
for i in range(m):
    c = input()
    total += dic[c]
print(total)
0