結果

問題 No.35 タイパー高橋
ユーザー e7a894e7a894
提出日時 2020-09-17 17:17:33
言語 Haskell
(9.8.2)
結果
AC  
実行時間 33 ms / 5,000 ms
コード長 418 bytes
コンパイル時間 1,030 ms
コンパイル使用メモリ 160,772 KB
実行使用メモリ 15,492 KB
最終ジャッジ日時 2023-09-04 07:23:31
合計ジャッジ時間 1,843 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
13,352 KB
testcase_01 AC 22 ms
13,416 KB
testcase_02 AC 32 ms
15,468 KB
testcase_03 AC 33 ms
15,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.Monad
import Data.List

main = do
  n <- readLn
  ws <- replicateM n $ words <$> getLine
  
  let ws' = map (\[x, y] -> (read x :: Int, length y)) ws
  let result = map solve ws'
  let ans1 = sum $ map fst result
  let ans2 = sum $ map snd result
  
  putStrLn $ (show ans1) ++ " " ++ (show ans2)

solve :: (Int, Int) -> (Int, Int)
solve (t, l) = (min c l, max 0 (l - c))
  where c = (t * 12) `div` 1000
0