結果

問題 No.69 文字を自由に並び替え
ユーザー nobigomunobigomu
提出日時 2018-04-20 00:29:45
言語 Lua
(LuaJit 2.1.1696795921)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-09 21:29:29
合計ジャッジ時間 840 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

local ffi = require 'ffi'
local C = ffi.C

ffi.cdef [[
void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
]]

print((function (f, a, b)
	return f(a) == f(b)
end)(function (s)
	local t = ffi.new("char [?]", #s, s)
	C.qsort(t, #s, 1, ffi.cast("int (*)(const char *, const char *)", function (a,b) return a[0]-b[0] end))
	return ffi.string(t)
end, io.stdin:read("*l"), io.stdin:read("*l")))
0