結果

問題 No.381 名声値を稼ごう Extra
ユーザー Fujisaki_prprFujisaki_prpr
提出日時 2016-06-20 21:39:15
言語 Haskell
(9.8.2)
結果
MLE  
実行時間 -
コード長 239 bytes
コンパイル時間 11,242 ms
コンパイル使用メモリ 173,184 KB
実行使用メモリ 814,520 KB
最終ジャッジ日時 2024-04-19 23:18:40
合計ジャッジ時間 13,730 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 MLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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

ソースコード

diff #

import Control.Applicative
import Control.Monad
main = do
    ss <- string2int <$> getLine
    putStrLn $ show (ss * 2 - (calc ss))

calc :: Integer -> Integer
calc 0 = 0
calc n = n + calc (n `div` 2)

string2int str = read str :: Integer
0