結果

問題 No.250 atetubouのzetubou
ユーザー ducktailducktail
提出日時 2018-07-01 15:11:53
言語 Haskell
(9.8.2)
結果
AC  
実行時間 1,082 ms / 5,000 ms
コード長 538 bytes
コンパイル時間 4,005 ms
コンパイル使用メモリ 166,204 KB
実行使用メモリ 23,856 KB
最終ジャッジ日時 2023-09-13 16:37:47
合計ジャッジ時間 16,558 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 633 ms
18,856 KB
testcase_01 AC 112 ms
12,744 KB
testcase_02 AC 962 ms
22,396 KB
testcase_03 AC 1,082 ms
23,856 KB
testcase_04 AC 942 ms
21,712 KB
testcase_05 AC 981 ms
22,736 KB
testcase_06 AC 753 ms
19,736 KB
testcase_07 AC 371 ms
15,368 KB
testcase_08 AC 892 ms
21,244 KB
testcase_09 AC 683 ms
18,840 KB
testcase_10 AC 972 ms
22,800 KB
testcase_11 AC 583 ms
17,528 KB
testcase_12 AC 873 ms
21,248 KB
testcase_13 AC 492 ms
16,916 KB
testcase_14 AC 12 ms
11,244 KB
testcase_15 AC 82 ms
19,128 KB
testcase_16 AC 82 ms
19,116 KB
testcase_17 AC 82 ms
19,260 KB
testcase_18 AC 82 ms
18,952 KB
testcase_19 AC 82 ms
19,192 KB
testcase_20 AC 2 ms
6,932 KB
testcase_21 AC 2 ms
7,308 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 #

import Control.Applicative ((<$>))
import Control.Monad (replicateM)

main :: IO ()
main = do
  n <- readLn
  solve <$> replicateM n (map read <$> words <$> getLine) >>= mapM_ putStrLn

solve :: [[Integer]] -> [String]
solve = map f
  where f [d, x, t] | hp (x+1) (d-1) <= t = "AC"
                    | otherwise = "ZETUBOU"

comb :: Integer -> Integer -> Integer
comb n m | m == 0 = 1
         | n < 2 * m = comb n (n - m)
         | otherwise = comb (n-1) (m-1) * n `div` m

hp :: Integer -> Integer -> Integer
hp n m = comb (n+m-1) m
0