結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー 👑 obakyanobakyan
提出日時 2019-03-30 19:27:37
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 215 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 6,940 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-28 02:18:53
合計ジャッジ時間 696 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 66 ms
6,940 KB
testcase_03 AC 66 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = io.read()
n = string.len(s)
t = {}
for i = 1, n do
    table.insert(t, tonumber(string.sub(s, i, i)))
end
table.sort(t, function(a, b) return a > b end)
for k, v in pairs(t) do
    io.write(v)
end
io.write("\n")
0