結果

問題 No.1131 Deviation Score
ユーザー nnsniconnsnico
提出日時 2020-08-02 19:06:10
言語 Haskell
(9.8.2)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 448 bytes
コンパイル時間 1,974 ms
コンパイル使用メモリ 164,164 KB
実行使用メモリ 15,588 KB
最終ジャッジ日時 2023-09-10 12:23:43
合計ジャッジ時間 4,175 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
12,060 KB
testcase_01 AC 4 ms
9,176 KB
testcase_02 AC 53 ms
15,092 KB
testcase_03 AC 22 ms
12,936 KB
testcase_04 AC 42 ms
14,544 KB
testcase_05 AC 22 ms
12,332 KB
testcase_06 AC 52 ms
14,700 KB
testcase_07 AC 33 ms
12,908 KB
testcase_08 AC 42 ms
14,232 KB
testcase_09 AC 22 ms
12,360 KB
testcase_10 AC 43 ms
14,272 KB
testcase_11 AC 43 ms
14,240 KB
testcase_12 AC 42 ms
14,084 KB
testcase_13 AC 43 ms
14,636 KB
testcase_14 AC 22 ms
11,996 KB
testcase_15 AC 23 ms
12,044 KB
testcase_16 AC 42 ms
14,488 KB
testcase_17 AC 22 ms
12,420 KB
testcase_18 AC 53 ms
15,588 KB
testcase_19 AC 3 ms
7,608 KB
testcase_20 AC 3 ms
7,004 KB
testcase_21 AC 3 ms
7,012 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 #

module Main where

import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.List
import Data.Maybe
import Control.Monad

main :: IO ()
main = do
  BS.getLine
  xn <- map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine
  let r = solve xn
  mapM_ print r

solve :: [Int] -> [Int]
solve xn = map (\x -> 50 - ceiling (fromIntegral (avr - x) / 2)) xn
  where
    avr = ceiling $ fromIntegral (sum xn) / fromIntegral (length xn)
0