結果
| 問題 | No.1005 BOT対策 |
| コンテスト | |
| ユーザー |
Mr.Fuku
|
| 提出日時 | 2020-07-14 13:21:42 |
| 言語 | Ruby (4.0.7 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 52 ms / 2,000 ms |
| + 309µs | |
| コード長 | 303 bytes |
| 記録 | |
| コンパイル時間 | 63 ms |
| コンパイル使用メモリ | 9,736 KB |
| 実行使用メモリ | 14,720 KB |
| 最終ジャッジ日時 | 2026-10-12 11:17:01 |
| 合計ジャッジ時間 | 3,597 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 |
コンパイルメッセージ
Main.rb:11: warning: ambiguous first argument; put parentheses or a space even after `-` operator Syntax OK
ソースコード
def is_impossible(s, t)
return false if t.size > 1
s.include?(t)
end
s = gets.chomp
t = gets.chomp
if is_impossible(s, t)
puts -1
return
end
cnt = 0
t_len = t.size
while true do
idx = s.index(t)
break if idx.nil?
s = s[idx+t_len-1...]
cnt += 1
end
puts cnt
Mr.Fuku