結果

問題 No.430 文字列検索
ユーザー ヒッキープログラミングするスレヒッキープログラミングするスレ
提出日時 2016-10-02 23:36:56
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 280 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 82,484 KB
実行使用メモリ 83,692 KB
最終ジャッジ日時 2024-05-01 10:51:03
合計ジャッジ時間 17,048 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
59,896 KB
testcase_01 AC 147 ms
76,324 KB
testcase_02 TLE -
testcase_03 AC 1,271 ms
76,724 KB
testcase_04 AC 34 ms
53,060 KB
testcase_05 AC 35 ms
53,036 KB
testcase_06 AC 33 ms
52,400 KB
testcase_07 AC 32 ms
52,832 KB
testcase_08 AC 51 ms
70,308 KB
testcase_09 AC 35 ms
54,384 KB
testcase_10 AC 43 ms
61,692 KB
testcase_11 AC 1,183 ms
76,268 KB
testcase_12 AC 1,164 ms
76,480 KB
testcase_13 AC 1,160 ms
76,504 KB
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

al = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

mp = {}

for c in al:
    mp[c] = []

s = input()
m = int(input())
for _ in range(m):
    c = input()
    mp[c[0]].append(c)

ans = 0
for i in range(len(s)):
    for x in mp[s[i]]:
        if x == s[i:i + len(x)]:
            ans += 1
print(ans)
0