結果
| 問題 | No.2773 Wake up Record 1 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-10-12 19:42:41 |
| 言語 | Rust (1.94.0 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| + 240µs | |
| コード長 | 519 bytes |
| 記録 | |
| コンパイル時間 | 574 ms |
| コンパイル使用メモリ | 186,520 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-15 16:40:00 |
| 合計ジャッジ時間 | 2,336 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
コンパイルメッセージ
warning: unused variable: `n` --> src/main.rs:5:9 | 5 | n: usize, | ^ help: if this is intentional, prefix it with an underscore: `_n` | = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
ソースコード
use proconio::input;
fn main() {
input! {
n: usize,
s: String,
}
let chars: Vec<char> = s.chars().collect();
let ans: Vec<usize> = chars
.windows(2)
.enumerate()
.filter(|(_, w)| w[0] == 'x' && w[1] == 'o')
.map(|(i, _)| i + 2)
.collect();
if ans.is_empty() {
println!("0");
println!(" ");
} else {
println!("{}", ans.len());
for a in ans {
print!("{a} ");
}
println!();
}
}