結果

問題 No.146 試験監督(1)
ユーザー Kaito UdagawaKaito Udagawa
提出日時 2015-02-09 00:00:41
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 489 bytes
コンパイル時間 2,100 ms
コンパイル使用メモリ 162,300 KB
実行使用メモリ 19,440 KB
最終ジャッジ日時 2023-09-05 12:39:05
合計ジャッジ時間 1,588 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 Data.Functor
import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Maybe

countExaminee :: [[Int]] -> Int
countExaminee (_:xs) = count xs `mod` 1000000007
  where
    count :: [[Int]] -> Int
    count [] = 0
    count ((c:d:_):xs) = ((c + 1) `div` 2) * d + count xs

readInts :: B.ByteString -> [Int]
readInts s = fst <$> mapMaybe (B.readInt) (B.words s)

main :: IO ()
main = countExaminee <$> (readInts <$>) <$> B.lines <$> B.getContents >>= putStrLn . show
0