結果
問題 |
No.3035 文字列のみの反転
|
ユーザー |
|
提出日時 | 2025-03-14 09:57:42 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 579 bytes |
コンパイル時間 | 12,977 ms |
コンパイル使用メモリ | 400,476 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-14 09:57:59 |
合計ジャッジ時間 | 14,575 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
#![allow(dead_code, unused_imports, unused_macros, non_snake_case)] use proconio::{ input, marker::{Bytes, Chars, Usize1}, }; fn main() { input! { s: Chars, } let alphabets = s .iter() .filter(|&c| c.is_alphabetic()) .copied() .collect::<Vec<_>>(); let numbers = s .iter() .filter(|&c| c.is_numeric()) .copied() .collect::<Vec<_>>(); let text = alphabets .iter() .rev() .chain(numbers.iter()) .collect::<String>(); println!("{}", text); }