結果

問題 No.3036 Nauclhlt型文字列
ユーザー Blue_S
提出日時 2025-01-07 22:00:26
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 16,243 ms
コンパイル使用メモリ 399,584 KB
実行使用メモリ 8,236 KB
最終ジャッジ日時 2025-02-28 20:50:45
合計ジャッジ時間 15,933 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;

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

    if n % 2 == 1 {
        println!("No");
    } else {
        let mut a = "".to_string();
        let mut b = "".to_string();
        for (i, c) in s.chars().enumerate() {
            if i % 2 == 0 {
                a += &c.to_string();
            } else {
                b += &c.to_string();
            }
        }
        println!("Yes\n{} {}", a, b);
    }
}
0