結果

問題 No.146 試験監督(1)
ユーザー NaruYNaruY
提出日時 2018-02-15 21:06:35
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 473 bytes
コンパイル時間 12,293 ms
コンパイル使用メモリ 165,356 KB
実行使用メモリ 201,828 KB
最終ジャッジ日時 2023-08-28 12:31:45
合計ジャッジ時間 18,014 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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
import Control.Applicative
import Data.List
import qualified Data.Map as Map
import Data.Array
strToInt s = (read :: String -> Int) s

main = do
    n <- readLn :: IO Int
    cd <- replicateM n (map read . words <$> getLine)
    print $ f cd
    
f :: [[Int]] -> Int
f [] = 0
f (a:an) = mod ((f an) + (g (head a)) * (last a)) 1000000007
            where g x = if (even x)
                        then div x 2
                        else (div x 2) + 1
0