結果
問題 | No.146 試験監督(1) |
ユーザー | momen999 |
提出日時 | 2017-04-20 07:42:51 |
言語 | Haskell (9.8.2) |
結果 |
TLE
|
実行時間 | - |
コード長 | 644 bytes |
コンパイル時間 | 1,132 ms |
コンパイル使用メモリ | 156,044 KB |
実行使用メモリ | 286,732 KB |
最終ジャッジ日時 | 2023-09-27 01:30:49 |
合計ジャッジ時間 | 7,486 ms |
ジャッジサーバーID (参考情報) |
judge15 / 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
ソースコード
import Control.Monad import Data.List checkMax :: (Integral a) => [a] -> [a] -> a checkMax cs ds = foldr ((+) . modm) 0 $ zipWith (*) cs ds modm a = a `mod` 1000000007 checkChair :: (Integral a) => a -> a checkChair c | even c == True = ce | odd c == True = co | otherwise = 0 where ce = div c 2 co = div c 2 + 1 main = do n <- readLn str <- replicateM n getLine let cd = map (map read . words) str :: [[Integer]] c = [head x | x <- cd] c' = map (modm . checkChair) c d = [last x | x <- cd] d' = map modm d print $ modm $ checkMax c' d'