結果
問題 | No.5003 物理好きクリッカー |
ユーザー | olphe |
提出日時 | 2018-12-01 03:10:20 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 344 ms / 10,000 ms |
コード長 | 2,729 bytes |
コンパイル時間 | 1,294 ms |
実行使用メモリ | 22,008 KB |
スコア | 115,856,284 |
平均クエリ数 | 10000.00 |
最終ジャッジ日時 | 2021-07-19 07:26:35 |
合計ジャッジ時間 | 13,919 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
純コード判定しない問題か言語 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 301 ms
21,840 KB |
testcase_01 | AC | 303 ms
21,864 KB |
testcase_02 | AC | 323 ms
21,888 KB |
testcase_03 | AC | 325 ms
21,684 KB |
testcase_04 | AC | 325 ms
21,504 KB |
testcase_05 | AC | 344 ms
21,876 KB |
testcase_06 | AC | 309 ms
21,528 KB |
testcase_07 | AC | 314 ms
21,540 KB |
testcase_08 | AC | 308 ms
21,336 KB |
testcase_09 | AC | 317 ms
21,684 KB |
testcase_10 | AC | 311 ms
21,360 KB |
testcase_11 | AC | 294 ms
21,864 KB |
testcase_12 | AC | 302 ms
21,360 KB |
testcase_13 | AC | 326 ms
21,876 KB |
testcase_14 | AC | 324 ms
21,348 KB |
testcase_15 | AC | 303 ms
21,516 KB |
testcase_16 | AC | 300 ms
21,528 KB |
testcase_17 | AC | 302 ms
21,504 KB |
testcase_18 | AC | 298 ms
21,516 KB |
testcase_19 | AC | 296 ms
21,360 KB |
testcase_20 | AC | 307 ms
21,936 KB |
testcase_21 | AC | 323 ms
21,420 KB |
testcase_22 | AC | 326 ms
21,888 KB |
testcase_23 | AC | 304 ms
21,876 KB |
testcase_24 | AC | 303 ms
21,912 KB |
testcase_25 | AC | 308 ms
21,864 KB |
testcase_26 | AC | 298 ms
21,876 KB |
testcase_27 | AC | 300 ms
21,516 KB |
testcase_28 | AC | 296 ms
21,552 KB |
testcase_29 | AC | 305 ms
21,540 KB |
testcase_30 | AC | 295 ms
21,876 KB |
testcase_31 | AC | 294 ms
21,504 KB |
ソースコード
#include "iostream" #include "climits" #include "list" #include "queue" #include "stack" #include "set" #include "functional" #include "algorithm" #include "string" #include "map" #include "unordered_map" #include "unordered_set" #include "iomanip" #include "cmath" #include "random" #include "bitset" #include "cstdio" #include "numeric" using namespace std; const long long int MOD = 1000000007; //const int MOD = 998244353; //long long int N, M, K, H, W, L, R; long long int N, M, K, H, W, L, R; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> N; string s; cin >> s; vector<string> buy_str = { "buy hand","buy lily","buy factory","buy casino","buy grimoire" }; vector<long long int>buy_cost = { 150,2000,30000,600000,10000000 }; vector<long long int>mpb = { 1,10,120,2000,25000 }; vector<int>num = { 0,0,0,0,0 }; vector<string>rein_str = { "reinforce hand","reinforce lily","reinforce factory","reinforce casino","reinforce grimoire" ,"enhclick" }; vector<long long int>rein_cost = { 1500,20000,300000,6000000,100000000,15 }; long long int click = 1; long long int money = 0; int fever = 0; bool sale = false; for (int i = 0; i < N; i++) { string ret = "click"; long long int use = MOD * MOD; for (auto j : buy_cost) use = min(use, j); for (auto j : rein_cost)use = min(use, j); if (sale) { if ((use * 90 + 99) / 100 <= money) { for (int j = 0; j < 5; j++) { if (use == buy_cost[j]) { ret = buy_str[j]; use = 0; num[j]++; money -= (buy_cost[j] * 90 + 99) / 100; buy_cost[j] = (buy_cost[j] * 6 + 4) / 5; } } for (int j = 0; j < 6; j++) { if (use == rein_cost[j]) { ret = rein_str[j]; use = 0; if (j < 5)mpb[j] *= 2; else click *= 2; money -= (rein_cost[j] * 90 + 99) / 100; rein_cost[j] *= 10; } } } } else { if (use <= money) { for (int j = 0; j < 5; j++) { if (use == buy_cost[j]) { ret = buy_str[j]; use = 0; num[j]++; money -= buy_cost[j]; buy_cost[j] = (6 * buy_cost[j] + 4) / 5; } } for (int j = 0; j < 6; j++) { if (use == rein_cost[j]) { ret = rein_str[j]; use = 0; if (j < 5)mpb[j] *= 2; else click *= 2; money -= rein_cost[j]; rein_cost[j] *= 10; } } } } long long int add = 0; if (ret == "click")add = click; for (int j = 0; j < 5; j++) { add += num[j] * mpb[j]; } if (fever > 0)add *= 7; money += add; sale = false; fever--; if (s[i] == 'B') { money = (money * 101 + 99) / 100; } if (s[i] == 'F') { fever = 20; } if(s[i] == 'S') { sale = true; } cout << ret << endl; string t; cin >> t; } return 0; }