結果

問題 No.430 文字列検索
ユーザー pluto77pluto77
提出日時 2016-10-07 08:54:20
言語 Python2
(2.7.18)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 232 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 6,784 KB
実行使用メモリ 6,784 KB
最終ジャッジ日時 2024-05-03 04:39:49
合計ジャッジ時間 2,802 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,016 KB
testcase_01 AC 155 ms
6,784 KB
testcase_02 AC 143 ms
6,784 KB
testcase_03 AC 145 ms
6,784 KB
testcase_04 AC 12 ms
6,144 KB
testcase_05 AC 11 ms
6,144 KB
testcase_06 AC 11 ms
6,272 KB
testcase_07 AC 11 ms
6,144 KB
testcase_08 AC 77 ms
6,144 KB
testcase_09 AC 11 ms
6,272 KB
testcase_10 AC 16 ms
6,144 KB
testcase_11 AC 150 ms
6,656 KB
testcase_12 AC 149 ms
6,784 KB
testcase_13 AC 150 ms
6,656 KB
testcase_14 AC 150 ms
6,784 KB
testcase_15 AC 155 ms
6,656 KB
testcase_16 AC 148 ms
6,656 KB
testcase_17 AC 149 ms
6,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki_430

s=raw_input()
n=int(raw_input())
d={}
mxl=0
for i in xrange(n):
 c=raw_input()
 d[c]=1
 mxl=max(len(c),mxl)

res=0
for i in xrange(len(s)):
 for j in xrange(1,min(len(s)-i,mxl)+1):
  if s[i:i+j] in d:
   res+=1
print res
0