結果
問題 |
No.430 文字列検索
|
ユーザー |
![]() |
提出日時 | 2022-12-12 21:08:43 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 744 ms / 2,000 ms |
コード長 | 363 bytes |
コンパイル時間 | 18,508 ms |
コンパイル使用メモリ | 378,868 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-10 01:03:19 |
合計ジャッジ時間 | 19,418 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 14 |
ソースコード
fn main() { let mut xx = String::new(); std::io::Read::read_to_string(&mut std::io::stdin(), &mut xx).ok(); let xx: Vec<Vec<char>> = xx.split_whitespace().map(|s| s.chars().collect()).collect(); let mut answer = 0; for s in &xx[2..] { answer += xx[0].windows(s.len()).filter(|&x| x == s).count(); } println!("{}", answer); }