結果

問題 No.784 「,(カンマ)」
ユーザー RokiRoki
提出日時 2019-06-19 00:35:54
言語 Haskell
(9.8.2)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 730 ms
コンパイル使用メモリ 157,096 KB
実行使用メモリ 6,728 KB
最終ジャッジ日時 2023-08-20 07:10:01
合計ジャッジ時間 1,630 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,636 KB
testcase_01 AC 3 ms
6,604 KB
testcase_02 AC 2 ms
6,632 KB
testcase_03 AC 2 ms
6,552 KB
testcase_04 AC 3 ms
6,604 KB
testcase_05 AC 3 ms
6,656 KB
testcase_06 AC 2 ms
6,636 KB
testcase_07 AC 3 ms
6,620 KB
testcase_08 AC 2 ms
6,608 KB
testcase_09 AC 2 ms
6,556 KB
testcase_10 AC 3 ms
6,676 KB
testcase_11 AC 3 ms
6,728 KB
testcase_12 AC 3 ms
6,636 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Data.List (unfoldr, intercalate)
main :: IO ()
main = putStrLn . intercalate "," . reverse . unfoldr (\xs -> if length xs >= 3 then Just (reverse $ take 3 xs, drop 3 xs) else if null xs then Nothing else Just (reverse xs, [])) . reverse =<< getLine
0