結果

問題 No.39 桁の数字を入れ替え
ユーザー 小指が強い人小指が強い人
提出日時 2015-12-31 23:09:44
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 169 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 11,936 KB
実行使用メモリ 16,128 KB
最終ジャッジ日時 2023-10-19 12:55:28
合計ジャッジ時間 2,785 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n = gets.strip
mi = 0
max = n[0].to_i
n.length.times do |i|
    t = n[i].to_i
    if t >= max
        max = t
        mi = i
    end
end
n[0], n[mi] = n[mi], n[0]
puts n
0