結果
問題 | No.5003 物理好きクリッカー |
ユーザー | morumotto |
提出日時 | 2018-12-10 00:56:11 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 85 ms / 10,000 ms |
コード長 | 2,194 bytes |
コンパイル時間 | 61 ms |
実行使用メモリ | 22,804 KB |
スコア | 576,640,114 |
平均クエリ数 | 10000.00 |
最終ジャッジ日時 | 2021-07-19 09:17:34 |
合計ジャッジ時間 | 4,939 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
純コード判定しない問題か言語 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 85 ms
22,564 KB |
testcase_01 | AC | 84 ms
22,556 KB |
testcase_02 | AC | 80 ms
22,656 KB |
testcase_03 | AC | 80 ms
22,720 KB |
testcase_04 | AC | 78 ms
22,636 KB |
testcase_05 | AC | 76 ms
22,260 KB |
testcase_06 | AC | 75 ms
22,544 KB |
testcase_07 | AC | 78 ms
22,328 KB |
testcase_08 | AC | 84 ms
22,556 KB |
testcase_09 | AC | 80 ms
22,680 KB |
testcase_10 | AC | 79 ms
22,548 KB |
testcase_11 | AC | 79 ms
22,448 KB |
testcase_12 | AC | 79 ms
22,656 KB |
testcase_13 | AC | 76 ms
22,608 KB |
testcase_14 | AC | 79 ms
22,744 KB |
testcase_15 | AC | 77 ms
22,424 KB |
testcase_16 | AC | 78 ms
22,448 KB |
testcase_17 | AC | 79 ms
22,448 KB |
testcase_18 | AC | 79 ms
22,512 KB |
testcase_19 | AC | 81 ms
22,604 KB |
testcase_20 | AC | 81 ms
22,328 KB |
testcase_21 | AC | 77 ms
22,756 KB |
testcase_22 | AC | 75 ms
22,672 KB |
testcase_23 | AC | 78 ms
22,716 KB |
testcase_24 | AC | 79 ms
22,432 KB |
testcase_25 | AC | 79 ms
22,692 KB |
testcase_26 | AC | 81 ms
22,460 KB |
testcase_27 | AC | 79 ms
22,276 KB |
testcase_28 | AC | 79 ms
22,716 KB |
testcase_29 | AC | 81 ms
22,492 KB |
testcase_30 | AC | 77 ms
22,624 KB |
testcase_31 | AC | 78 ms
22,532 KB |
ソースコード
import math n = int(input()) s = input() fac_power = {"enhclick":1, "hand":1, "lily":10, "factory":120, "casino":2000, "grimoire":25000} buy_count = {"enhclick":0, "hand":0, "lily":0, "factory":0, "casino":0, "grimoire":0} buy_price = {"buy hand":150, "buy lily":2000, "buy factory":30000, "buy casino":600000, "buy grimoire":10000000} rei_price = {"enhclick":15, "reinforce hand":1500, "reinforce lily":20000, "reinforce factory":300000, "reinforce casino":6000000, "reinforce grimoire":100000000} fac_names = {"hand", "lily", "factory", "casino", "grimoire"} turn = 0 cookie_count = 0 fever = 0 sale = False while turn < n: #------------- player_action ------------- act = None price = 0 for k, v in buy_price.items(): if sale: if cookie_count >= v * 0.9 and v * 0.9 > price: act, price = k, v * 0.9 else: if cookie_count >= v and v > price: act, price = k, v for k, v in rei_price.items(): if sale: if cookie_count >= v * 0.9 and v * 0.9 > price: act, price = k, v * 0.9 else: if cookie_count >= v and v > price: act, price = k, v if act == None: print("click") cookie_count += fac_power["enhclick"] else: if act in buy_price: print(act) buy_price[act] = math.ceil(buy_price[act] * 1.2) buy_count[act.split()[-1]] += 1 cookie_count -= math.ceil(price) elif act in rei_price: print(act) rei_price[act] *= 10 fac_power[act.split()[-1]] *= 2 cookie_count -= price #------------- facility_action ----------- add = sum([fac_power[k] * buy_count[k] for k in fac_names]) if fever: add *= 7 fever -= 1 cookie_count += add #------------- special_action ------------ special_act = s[turn] if s == "B": cookie_count += math.ceil(cookie_count / 100) elif s == "F": fever = 20 elif s == "S": sale = True #------------- turn++ ------------------ turn += 1