結果

問題 No.146 試験監督(1)
コンテスト
ユーザー e7a894
提出日時 2018-09-14 19:32:19
言語 Haskell
(9.14.1)
コンパイル:
ghc -rtsopts -with-rtsopts=-K1G -o a.out -O2 _filename_
実行:
./a.out
結果
MLE  
実行時間 -
コード長 376 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,596 ms
コンパイル使用メモリ 195,968 KB
実行使用メモリ 204,416 KB
最終ジャッジ日時 2026-03-27 13:37:58
合計ジャッジ時間 13,028 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other MLE * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #
raw source code

import Control.Monad

main = do
  n <- readLn :: IO Int
  -- cs <- map (map read . words) <$> replicateM n getLine
  cs <- replicateM n $ (map read . words) <$> getLine
  putStrLn . show $ (solve cs) `mod` (10^9+7)
  
solve :: [[Int]] -> Int
solve xs = sum $ map fn xs
  where fn [x, y] = if even x then (x `div` 2 * y) `mod` (10^9+7) else ((x `div` 2 + 1) * y) `mod` (10^9+7)
0