結果
問題 | No.3036 Nauclhlt型文字列 |
ユーザー |
|
提出日時 | 2025-02-28 21:42:22 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 1,056 bytes |
コンパイル時間 | 12,000 ms |
コンパイル使用メモリ | 403,968 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-02-28 21:42:52 |
合計ジャッジ時間 | 13,023 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 |
ソースコード
fn main() { input!{ n: usize, s: Chars, } // 長さは偶数でないといけない if n % 2 != 0 { println!("No"); return; } // 偶数なら一つ飛ばしの文字列にする let mut str1 = Vec::new(); let mut str2 = Vec::new(); for i in 0..n { if i % 2 == 0 { str1.push(s[i]);} else { str2.push(s[i]);} } // 出力 println!("Yes"); for ss in str1 { print!("{}", ss); } print!(" "); for ss in str2 { print!("{}", ss); } println!(); } // const MOD17: usize = 1000000007; // const MOD93: usize = 998244353; // const INF: usize = 1 << 60; // let dx = vec![!0, 0, 1, 0]; // 上左下右 // let dy = vec![0, !0, 0, 1]; // 上左下右 // let d = vec!{(!0, 0), (0, !0), (1, 0), (0, 1)}; // 上左下右 #[allow(unused)] use proconio::{input, marker::Chars, marker::Usize1}; #[allow(unused)] use std::{ mem::swap, cmp::min, cmp::max, cmp::Reverse, collections::HashSet, collections::BTreeSet, collections::HashMap, collections::BTreeMap, collections::BinaryHeap, collections::VecDeque, iter::FromIterator, };