結果

問題 No.51 やる気の問題
ユーザー 情報学生情報学生
提出日時 2019-08-19 10:22:19
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 442 bytes
コンパイル時間 10,302 ms
コンパイル使用メモリ 171,392 KB
実行使用メモリ 15,392 KB
最終ジャッジ日時 2024-04-10 10:35:49
合計ジャッジ時間 15,613 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,816 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 51 ms
6,940 KB
testcase_04 AC 5 ms
6,944 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 #

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)
0