結果

問題 No.146 試験監督(1)
ユーザー e7a894e7a894
提出日時 2018-09-14 19:20:41
言語 Haskell
(9.6.2)
結果
TLE  
実行時間 -
コード長 466 bytes
コンパイル時間 9,109 ms
コンパイル使用メモリ 159,472 KB
実行使用メモリ 198,696 KB
最終ジャッジ日時 2023-09-20 05:34:07
合計ジャッジ時間 15,289 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 MLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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

main = do
  n <- readLn :: IO Int
  cs <- map (map read . words) <$> replicateM n getLine
  -- putStrLn . show $ sum $ map fn cs
  -- where
  --   fn [x, y] = if even x then x `div` 2 * y else (x `div` 2 + 1) * y
  putStrLn . show $ solve cs
  
solve :: [[Int]] -> Int
solve xs = sum $ map fn xs
  -- where fn [x, y] = if even x then x `div` 2 * y else (x `div` 2 + 1) * y
  where fn [x, y] = (ceiling $ (fromIntegral x) / (fromIntegral 2)) * y
0