結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー zaichuzaichu
提出日時 2016-09-17 22:52:48
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 245 bytes
コンパイル時間 8,240 ms
コンパイル使用メモリ 172,928 KB
実行使用メモリ 22,432 KB
最終ジャッジ日時 2024-04-28 15:21:56
合計ジャッジ時間 11,158 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
13,756 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 TLE -
testcase_03 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Control.Applicative
main :: IO ()
main = do
  s <- getLine
  putStrLn $ solve s

solve :: Ord a => [a] -> [a]
solve [] = []
solve (x:xs) = solve large ++ [x] ++ solve small
  where
    small = filter (<= x) xs
    large = filter (> x) xs
0