結果
問題 |
No.39 桁の数字を入れ替え
|
ユーザー |
![]() |
提出日時 | 2022-12-11 22:00:22 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 442 bytes |
コンパイル時間 | 16,935 ms |
コンパイル使用メモリ | 394,864 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-15 17:17:56 |
合計ジャッジ時間 | 16,743 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let mut n: Vec<char> = n.trim().chars().collect(); let mut max = n.clone(); for i in 0..n.len() { for j in 0..n.len() { n.swap(i, j); if n > max { max = n.clone(); } n.swap(i, j); } } let max: String = max.iter().collect(); println!("{}", max); }