結果
問題 | No.5018 Let's Make a Best-seller Book |
ユーザー | e869120 |
提出日時 | 2023-09-18 13:56:13 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 66 ms / 400 ms |
コード長 | 1,940 bytes |
コンパイル時間 | 636 ms |
コンパイル使用メモリ | 72,144 KB |
実行使用メモリ | 24,396 KB |
スコア | 22,776 |
平均クエリ数 | 52.00 |
最終ジャッジ日時 | 2023-10-01 12:30:42 |
合計ジャッジ時間 | 9,047 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
純コード判定しない問題か言語 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 38 ms
23,640 KB |
testcase_01 | AC | 32 ms
23,412 KB |
testcase_02 | AC | 31 ms
23,376 KB |
testcase_03 | AC | 32 ms
24,048 KB |
testcase_04 | AC | 32 ms
24,036 KB |
testcase_05 | AC | 31 ms
23,664 KB |
testcase_06 | AC | 31 ms
24,060 KB |
testcase_07 | AC | 32 ms
23,376 KB |
testcase_08 | AC | 31 ms
24,384 KB |
testcase_09 | AC | 33 ms
24,396 KB |
testcase_10 | AC | 32 ms
24,360 KB |
testcase_11 | AC | 32 ms
24,000 KB |
testcase_12 | AC | 31 ms
23,388 KB |
testcase_13 | AC | 33 ms
23,508 KB |
testcase_14 | AC | 31 ms
23,388 KB |
testcase_15 | AC | 32 ms
24,384 KB |
testcase_16 | AC | 32 ms
24,264 KB |
testcase_17 | AC | 32 ms
23,616 KB |
testcase_18 | AC | 33 ms
23,412 KB |
testcase_19 | AC | 31 ms
23,376 KB |
testcase_20 | AC | 31 ms
24,060 KB |
testcase_21 | AC | 31 ms
23,376 KB |
testcase_22 | AC | 31 ms
23,400 KB |
testcase_23 | AC | 32 ms
24,252 KB |
testcase_24 | AC | 31 ms
23,388 KB |
testcase_25 | AC | 32 ms
23,364 KB |
testcase_26 | AC | 32 ms
23,520 KB |
testcase_27 | AC | 33 ms
23,412 KB |
testcase_28 | AC | 31 ms
23,532 KB |
testcase_29 | AC | 34 ms
24,384 KB |
testcase_30 | AC | 31 ms
24,048 KB |
testcase_31 | AC | 31 ms
24,060 KB |
testcase_32 | AC | 31 ms
23,388 KB |
testcase_33 | AC | 31 ms
24,336 KB |
testcase_34 | AC | 31 ms
24,264 KB |
testcase_35 | AC | 31 ms
24,012 KB |
testcase_36 | AC | 32 ms
24,336 KB |
testcase_37 | AC | 33 ms
23,640 KB |
testcase_38 | AC | 31 ms
23,364 KB |
testcase_39 | AC | 32 ms
24,036 KB |
testcase_40 | AC | 32 ms
23,376 KB |
testcase_41 | AC | 33 ms
23,664 KB |
testcase_42 | AC | 32 ms
24,348 KB |
testcase_43 | AC | 32 ms
23,424 KB |
testcase_44 | AC | 32 ms
23,652 KB |
testcase_45 | AC | 32 ms
23,628 KB |
testcase_46 | AC | 32 ms
23,376 KB |
testcase_47 | AC | 31 ms
24,024 KB |
testcase_48 | AC | 36 ms
23,532 KB |
testcase_49 | AC | 33 ms
24,384 KB |
testcase_50 | AC | 32 ms
23,832 KB |
testcase_51 | AC | 32 ms
24,012 KB |
testcase_52 | AC | 31 ms
23,400 KB |
testcase_53 | AC | 32 ms
23,628 KB |
testcase_54 | AC | 31 ms
23,364 KB |
testcase_55 | AC | 32 ms
23,520 KB |
testcase_56 | AC | 32 ms
24,372 KB |
testcase_57 | AC | 35 ms
23,412 KB |
testcase_58 | AC | 32 ms
23,412 KB |
testcase_59 | AC | 32 ms
24,348 KB |
testcase_60 | AC | 32 ms
23,508 KB |
testcase_61 | AC | 66 ms
23,376 KB |
testcase_62 | AC | 32 ms
24,384 KB |
testcase_63 | AC | 33 ms
23,628 KB |
testcase_64 | AC | 32 ms
24,024 KB |
testcase_65 | AC | 33 ms
23,640 KB |
testcase_66 | AC | 33 ms
23,628 KB |
testcase_67 | AC | 32 ms
23,676 KB |
testcase_68 | AC | 32 ms
23,820 KB |
testcase_69 | AC | 32 ms
23,520 KB |
testcase_70 | AC | 32 ms
23,400 KB |
testcase_71 | AC | 32 ms
23,220 KB |
testcase_72 | AC | 32 ms
23,628 KB |
testcase_73 | AC | 32 ms
24,048 KB |
testcase_74 | AC | 32 ms
23,376 KB |
testcase_75 | AC | 31 ms
24,360 KB |
testcase_76 | AC | 31 ms
23,508 KB |
testcase_77 | AC | 31 ms
24,324 KB |
testcase_78 | AC | 32 ms
24,348 KB |
testcase_79 | AC | 33 ms
23,652 KB |
testcase_80 | AC | 31 ms
23,628 KB |
testcase_81 | AC | 32 ms
24,048 KB |
testcase_82 | AC | 32 ms
23,364 KB |
testcase_83 | AC | 32 ms
23,412 KB |
testcase_84 | AC | 32 ms
24,036 KB |
testcase_85 | AC | 32 ms
23,364 KB |
testcase_86 | AC | 33 ms
24,372 KB |
testcase_87 | AC | 32 ms
24,036 KB |
testcase_88 | AC | 33 ms
23,364 KB |
testcase_89 | AC | 32 ms
24,324 KB |
testcase_90 | AC | 32 ms
24,024 KB |
testcase_91 | AC | 33 ms
23,376 KB |
testcase_92 | AC | 32 ms
24,012 KB |
testcase_93 | AC | 33 ms
24,024 KB |
testcase_94 | AC | 33 ms
23,376 KB |
testcase_95 | AC | 33 ms
24,024 KB |
testcase_96 | AC | 32 ms
23,520 KB |
testcase_97 | AC | 32 ms
23,532 KB |
testcase_98 | AC | 32 ms
23,436 KB |
testcase_99 | AC | 33 ms
24,024 KB |
ソースコード
#include <iostream> #include <cmath> #include <algorithm> using namespace std; int T, N; int Money; int L[19]; int S[19], P[19], R[19]; int Prev_Ad; double Expected_D[19], Sum_D[19], Cnt_D[19]; void Decide_L(int turn) { // 広告を打つ場合 if (turn >= 6 && Money >= 1500000 && turn - Prev_Ad) { cout << "2 2" << endl; Prev_Ad = turn; } else { int NeedMoney = 0; for (int i = 1; i <= N; i++) { double keisuu = 9.0; if (P[i] >= 50) keisuu = 75.0; int Goal = keisuu * pow(1.05, 1.0 * P[i]) * Expected_D[i] * pow(1.05, 1.0 * P[i]); Goal = max(1, Goal - R[i]); L[i] = Goal; NeedMoney += 500 * Goal; } if (NeedMoney > Money) { for (int i = 1; i <= N; i++) L[i] = (1LL * L[i] * Money / NeedMoney); } cout << 1; for (int i = 1; i <= N; i++) cout << " " << L[i]; cout << endl; } } int main() { // 最初の入力 cin >> T >> N >> Money; for (int i = 1; i <= N; i++) Expected_D[i] = 1.0; // インタラクティブ開始 for (int t = 1; t <= T; t++) { // (あ) 行動を決める Decide_L(t); // (い) 売上部数などを入力する cin >> Money; for (int i = 1; i <= N; i++) cin >> S[i]; for (int i = 1; i <= N; i++) cin >> P[i]; for (int i = 1; i <= N; i++) cin >> R[i]; // D の値を更新 for (int i = 1; i <= N; i++) { if (S[i] == 0) continue; int moto_popular = P[i]; if (10 * S[i] >= 3 * (S[i] + R[i])) moto_popular -= 1; if (10 * S[i] < 1 * (S[i] + R[i])) moto_popular += 1; double expected = (0.5 + S[i]) / (pow(1.0 * (S[i] + R[i]), 0.5) * pow(1.05, moto_popular)); Sum_D[i] += expected; Cnt_D[i] += 1.0; Expected_D[i] = min(1.45, max(0.55, Sum_D[i] / Cnt_D[i])); } // デバッグ出力 cerr << Money << endl; for (int i = 1; i <= N; i++) cerr << S[i] << " "; cerr << endl; for (int i = 1; i <= N; i++) cerr << P[i] << " "; cerr << endl; for (int i = 1; i <= N; i++) cerr << R[i] << " "; cerr << endl; } return 0; }