結果
問題 |
No.51 やる気の問題
|
ユーザー |
![]() |
提出日時 | 2019-08-19 10:22:19 |
言語 | Haskell (9.10.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 442 bytes |
コンパイル時間 | 2,619 ms |
コンパイル使用メモリ | 172,416 KB |
実行使用メモリ | 13,696 KB |
最終ジャッジ日時 | 2024-10-02 12:26:23 |
合計ジャッジ時間 | 9,230 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 2 TLE * 1 -- * 17 |
コンパイルメッセージ
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
ソースコード
main :: IO () main = interact $ show . solve . map read . words myFloor :: Int -> Int -> Int myFloor m n = floor $ (fromIntegral m) / (fromIntegral n) solve :: [Int] -> Int solve [works, deadline] = yaruki deadline where yaruki_memo :: [Int] yaruki_memo = map yaruki [0..] yaruki :: Int -> Int yaruki 0 = 0 yaruki x = myFloor (works - (sum $ take x yaruki_memo)) ((deadline - x + 1) ^ 2)