結果
問題 |
No.3035 文字列のみの反転
|
ユーザー |
|
提出日時 | 2025-02-28 21:34:50 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 1,007 bytes |
コンパイル時間 | 12,641 ms |
コンパイル使用メモリ | 402,824 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-02-28 21:35:07 |
合計ジャッジ時間 | 11,963 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
fn main() { // 入力 input!{ s: Chars, } // 文字と数字をそれぞれリストにする let mut str = Vec::new(); let mut num = Vec::new(); // 文字または数字をセット for ss in s { if ss >= 'a' && ss <= 'z' { str.push(ss);} else {num.push(ss);} } // 文字を反転 str.reverse(); // 出力 for ss in str { print!("{}", ss); } for nn in num { print!("{}", nn); } 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, };