結果

問題 No.3036 Nauclhlt型文字列
ユーザー kyotoku1483
提出日時 2025-03-01 22:54:37
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 549 bytes
コンパイル時間 13,156 ms
コンパイル使用メモリ 391,636 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-03-01 22:54:52
合計ジャッジ時間 13,532 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

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

fn main() {
    input! {
        n: usize,
        s: Chars,
    }
    if n % 2 == 0 {
        let mut x = vec!['0'; n / 2];
        let mut y = vec!['0'; n / 2];
        for i in 0..n {
            if i % 2 == 0 {
                x[i / 2] = s[i];
            } else {
                y[i / 2] = s[i];
            }
        }
        println!("Yes");
        println!("{} {}", x.iter().collect::<String>(), y.iter().collect::<String>())
    } else {
        println!("No")
    }
}
0