結果
| 問題 |
No.5003 物理好きクリッカー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-01 08:18:17 |
| 言語 | Haskell (9.10.1) |
| 結果 |
AC
|
| 実行時間 | 40 ms / 10,000 ms |
| コード長 | 623 bytes |
| コンパイル時間 | 3,335 ms |
| 実行使用メモリ | 21,972 KB |
| スコア | 3,322,073,893 |
| 平均クエリ数 | 15041.16 |
| 最終ジャッジ日時 | 2021-07-19 07:33:18 |
| 合計ジャッジ時間 | 7,164 ms |
|
ジャッジサーバーID (参考情報) |
judge10 / judge14 |
| 純コード判定しない問題か言語 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 32 |
コンパイルメッセージ
Loaded package environment from /root/.ghc/x86_64-linux-8.10.4/environments/default [1 of 1] Compiling Main ( Main.hs, Main.o ) Linking a.out ...
ソースコード
-- Try yukicoder
-- author: Leonardone
main = do
n <- readLn
putStrLn . unlines $ game n 0 0
game 0 _ _ = replicate 80000 "nothing"
game n r h =
case item n r xs of
Nothing -> "click" : game (n - 1) (r + h + 1) h
Just (g, c, cmd) -> cmd : game (n - 1) (r - c + h) (h + g)
xs = [(25000, 10000000, "buy grimoire")
,( 2000, 600000, "buy casino")
,( 120, 30000, "buy factory")
,( 10, 2000, "buy lily")
,( 1, 150, "buy hand")
]
item _ _ [] = Nothing
item n r (x@(g, c, _):xs)
| n * g > c && r >= c = Just x
| otherwise = item n r xs