結果

問題 No.293 4>7の世界
ユーザー nobigomunobigomu
提出日時 2018-04-20 20:04:32
言語 Lua
(LuaJit 2.1.1734355927)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 360 bytes
コンパイル時間 562 ms
コンパイル使用メモリ 5,504 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-30 12:37:24
合計ジャッジ時間 1,526 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

print((function (f, g, s)
	local a,b = s:match("(%d+)%s(%d+)")
	return #a>#b and a or #b>#a and b or f(g,a,b)
end)(function (f, a, b)
	for i=1,#a do
		local c,d = f(a:sub(i,i),b:sub(i,i))
		if c~=d then return c>d and a or b end
	end
end, function (a, b)
	if (a=="4" and b=="7") or (a=="7" and b=="4") then return b,a end
	return a,b
end, io.stdin:read("*l")))
0