結果

問題 No.51 やる気の問題
ユーザー seatofhorseseatofhorse
提出日時 2017-12-20 22:52:21
言語 Haskell
(9.8.2)
結果
AC  
実行時間 22 ms / 5,000 ms
コード長 436 bytes
コンパイル時間 9,053 ms
コンパイル使用メモリ 161,720 KB
実行使用メモリ 15,052 KB
最終ジャッジ日時 2023-08-22 11:04:19
合計ジャッジ時間 9,710 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,008 KB
testcase_01 AC 3 ms
6,980 KB
testcase_02 AC 2 ms
6,992 KB
testcase_03 AC 3 ms
7,336 KB
testcase_04 AC 3 ms
7,164 KB
testcase_05 AC 12 ms
12,468 KB
testcase_06 AC 6 ms
10,756 KB
testcase_07 AC 7 ms
10,656 KB
testcase_08 AC 5 ms
9,080 KB
testcase_09 AC 22 ms
14,952 KB
testcase_10 AC 5 ms
9,476 KB
testcase_11 AC 5 ms
9,196 KB
testcase_12 AC 7 ms
11,144 KB
testcase_13 AC 12 ms
11,328 KB
testcase_14 AC 6 ms
10,264 KB
testcase_15 AC 12 ms
13,300 KB
testcase_16 AC 5 ms
8,732 KB
testcase_17 AC 3 ms
7,580 KB
testcase_18 AC 12 ms
13,724 KB
testcase_19 AC 12 ms
13,724 KB
testcase_20 AC 7 ms
10,868 KB
testcase_21 AC 3 ms
7,596 KB
testcase_22 AC 22 ms
15,052 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 Control.Monad.State

type Work = Int
type Day = Int
type WorkState = (Work, Day)

solve :: State WorkState Work

solve = do
    (work, day) <- get
    let today = work `div` day ^ 2
    if day == 1 
        then return work
        else do
            put (work-today, day-1)
            solve

main :: IO()

main = do
    w <- read <$> getLine
    d <- read <$> getLine
    print $ fst $ runState solve (w,d)
0