結果
問題 | No.146 試験監督(1) |
ユーザー | okaduki |
提出日時 | 2015-02-21 00:46:25 |
言語 | Haskell (9.8.2) |
結果 |
AC
|
実行時間 | 83 ms / 1,000 ms |
コード長 | 517 bytes |
コンパイル時間 | 2,599 ms |
コンパイル使用メモリ | 164,540 KB |
実行使用メモリ | 15,668 KB |
最終ジャッジ日時 | 2023-09-06 02:38:35 |
合計ジャッジ時間 | 2,455 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 82 ms
15,660 KB |
testcase_01 | AC | 82 ms
15,664 KB |
testcase_02 | AC | 83 ms
15,668 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.Applicative import Text.Printf import Data.Maybe (fromJust) import qualified Data.ByteString.Lazy as L import qualified Data.ByteString.Lazy.Char8 as L8 main = do n <- fmap (read :: String -> Int) . words <$> getLine xs <- fmap (fmap (fst . fromJust . L8.readInteger) . L8.words) . L8.lines <$> L.getContents print $ solve xs solve [] = 0 solve ([c,d]:xs) = add (solve xs) (mul ((c+1) `div` 2) d) where add x y = (x + y) `mod` m mul x y = (x * y) `mod` m m = 1000000000 + 7