結果

問題 No.2773 Wake up Record 1
ユーザー kyotoku1483
提出日時 2025-03-25 20:17:58
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 466 bytes
コンパイル時間 27,898 ms
コンパイル使用メモリ 378,260 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-25 20:18:28
合計ジャッジ時間 15,186 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#[allow(unused)]
use proconio::{input, marker::Chars};

fn main() {
    input! {
        n: usize,
        s: Chars,
    }
    let mut cnt = 0;
    let mut a = Vec::new();
    for i in 1..n {
        if s[i] == 'o' && s[i - 1] == 'x' {
            a.push(i + 1);
            cnt += 1;
        }
    }
    println!("{}", cnt);
    if cnt > 0 {
        print!("{}", a[0]);
        for x in a[1..].iter() {
            print!(" {}", x)
        }
    }
    println!()
}
0