結果

問題 No.35 タイパー高橋
ユーザー ducktailducktail
提出日時 2018-01-04 21:52:00
言語 Haskell
(9.8.2)
結果
AC  
実行時間 32 ms / 5,000 ms
コード長 522 bytes
コンパイル時間 7,503 ms
コンパイル使用メモリ 164,676 KB
実行使用メモリ 17,612 KB
最終ジャッジ日時 2023-08-24 19:03:09
合計ジャッジ時間 8,576 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
14,120 KB
testcase_01 AC 22 ms
14,160 KB
testcase_02 AC 32 ms
17,612 KB
testcase_03 AC 32 ms
17,492 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 Control.Applicative ((<$>))
import Control.Monad (replicateM)
import Data.List

main :: IO ()
main = do
  n <- getl read
  solve <$> replicateM n (getl words) >>= putStrLn

solve :: [[String]] -> String
solve = intercalate " " . map show . foldl' f [0, 0]
  where
    f :: [Int] -> [String] -> [Int]
    f [tc, mc] [t, s] = let x = 12 * read t `div` 1000
                            y = min x (length s)
                        in [tc + y, mc + (length s) - y]

getl :: (String -> a) -> IO a
getl f = f <$> getLine
0