結果

問題 No.430 文字列検索
ユーザー shi-moshi-mo
提出日時 2020-10-01 23:40:40
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,276 ms / 2,000 ms
コード長 163 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 11,380 KB
実行使用メモリ 60,100 KB
最終ジャッジ日時 2023-09-21 16:50:14
合計ジャッジ時間 12,878 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,244 KB
testcase_01 AC 1,027 ms
48,204 KB
testcase_02 AC 891 ms
60,008 KB
testcase_03 AC 629 ms
58,604 KB
testcase_04 AC 85 ms
15,168 KB
testcase_05 AC 84 ms
15,044 KB
testcase_06 AC 85 ms
15,112 KB
testcase_07 AC 82 ms
15,136 KB
testcase_08 AC 83 ms
15,372 KB
testcase_09 AC 84 ms
15,184 KB
testcase_10 AC 102 ms
17,508 KB
testcase_11 AC 1,276 ms
31,512 KB
testcase_12 AC 1,249 ms
28,704 KB
testcase_13 AC 1,245 ms
28,728 KB
testcase_14 AC 1,081 ms
31,028 KB
testcase_15 AC 1,111 ms
45,792 KB
testcase_16 AC 1,124 ms
58,796 KB
testcase_17 AC 1,148 ms
60,100 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = gets.chomp
m = gets.to_i
c = m.times.map{ gets.chomp }

n = 0
c.each do |ci|
  si = s
  while /#{ci}/ =~ si
    si = ($& + $')[1..]
    n += 1
  end
end
puts n
0