結果
問題 | No.120 傾向と対策:門松列(その1) |
ユーザー | aimy |
提出日時 | 2017-05-01 08:22:22 |
言語 | Haskell (9.8.2) |
結果 |
AC
|
実行時間 | 312 ms / 5,000 ms |
コード長 | 388 bytes |
コンパイル時間 | 9,871 ms |
コンパイル使用メモリ | 161,052 KB |
実行使用メモリ | 11,432 KB |
最終ジャッジ日時 | 2023-10-12 01:56:57 |
合計ジャッジ時間 | 9,663 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 272 ms
11,432 KB |
testcase_01 | AC | 302 ms
11,300 KB |
testcase_02 | AC | 142 ms
11,332 KB |
testcase_03 | AC | 312 ms
11,324 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
ソースコード
import Control.Monad import Data.Ord import Data.List main = do t <- readLn replicateM_ t $ do getLine ls <- map read . words <$> getLine :: IO [Integer] print (kadomatsu ls) kadomatsu = length . unfoldr take3 . sort' . group . sort where sort' = sortBy (flip (comparing length)) take3 ((_:ls1):(_:ls2):(_:ls3):lss) = Just ((), sort' (ls1:ls2:ls3:lss)) take3 _ = Nothing