結果
問題 | No.1005 BOT対策 |
ユーザー |
![]() |
提出日時 | 2022-12-23 19:19:57 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 522 bytes |
コンパイル時間 | 11,910 ms |
コンパイル使用メモリ | 402,708 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-01 20:14:39 |
合計ジャッジ時間 | 12,589 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
fn main() {let mut xx = String::new();std::io::Read::read_to_string(&mut std::io::stdin(), &mut xx).ok();let xx: Vec<&str> = xx.split_whitespace().collect();let (mut s, t) = (xx[0], xx[1]);if t.len() == 1 {if s.contains(t) {println!("-1");} else {println!("0");}} else {let mut n = 0;while let Some(i) = s.find(t) {s = &s[i + t.len() - 1..];n += 1;}println!("{n}");}}