結果

問題 No.39 桁の数字を入れ替え
ユーザー maimai
提出日時 2016-06-25 02:18:24
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 228 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-04-20 02:32:23
合計ジャッジ時間 2,590 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
12,160 KB
testcase_01 AC 91 ms
12,288 KB
testcase_02 AC 90 ms
12,288 KB
testcase_03 AC 90 ms
12,288 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 89 ms
12,032 KB
testcase_09 AC 91 ms
12,032 KB
testcase_10 AC 91 ms
12,160 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 90 ms
12,160 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a=gets.chomp.chars.to_a.map(&:to_i)

max=a
0.upto(a.size-2){|i|
    (i+1).upto(a.size-1){|j|
        at=a.clone
        t=at[i]
        at[i]=at[j]
        at[j]=t
        max=at if (a*"").to_i < (at*"").to_i
    }
}
puts max*""
0