結果
| 問題 |
No.51 やる気の問題
|
| コンテスト | |
| ユーザー |
kotarou777775
|
| 提出日時 | 2016-12-08 16:36:42 |
| 言語 | Haskell (9.10.1) |
| 結果 |
AC
|
| 実行時間 | 12 ms / 5,000 ms |
| コード長 | 408 bytes |
| コンパイル時間 | 4,247 ms |
| コンパイル使用メモリ | 172,160 KB |
| 実行使用メモリ | 11,904 KB |
| 最終ジャッジ日時 | 2024-11-28 15:19:50 |
| 合計ジャッジ時間 | 3,675 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
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
ソースコード
import Control.Monad.State
input = (read :: String -> Int) <$> getLine
hoge :: State (Int, Int) Int
hoge = do
(workLeft, dayLeft) <- get
if dayLeft /= 1 then do
let w = workLeft `div` dayLeft^2
nw = workLeft - w
put (nw, dayLeft-1)
hoge
else
return workLeft
main = do{ w <- input; d <- input; return (w,d)} >>= \n -> print $ fst $ runState hoge n
kotarou777775