結果

問題 No.3036 Nauclhlt型文字列
ユーザー The_Bouningeeeen
提出日時 2025-02-28 21:40:16
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 516 bytes
コンパイル時間 12,444 ms
コンパイル使用メモリ 396,512 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-02-28 21:40:45
合計ジャッジ時間 11,710 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::{input, marker::Chars};

fn main() {
    input! {
        n: usize,
        s: Chars,
    }

    let mut p = vec![];
    let mut q = vec![];
    for i in 0..n {
        if i % 2 == 0 {
            p.push(s[i]);
        } else {
            q.push(s[i]);
        }
    }

    if p.len() == q.len() {
        println!("Yes");
        println!(
            "{} {}",
            p.iter().collect::<String>(),
            q.iter().collect::<String>()
        );
    } else {
        println!("No");
    }
}
0