結果
| 問題 |
No.146 試験監督(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-08 23:59:27 |
| 言語 | Haskell (9.10.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 489 bytes |
| コンパイル時間 | 10,149 ms |
| コンパイル使用メモリ | 181,036 KB |
| 実行使用メモリ | 16,000 KB |
| 最終ジャッジ日時 | 2024-06-23 08:18:21 |
| 合計ジャッジ時間 | 6,986 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 3 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
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