結果
| 問題 |
No.5018 Let's Make a Best-seller Book
|
| コンテスト | |
| ユーザー |
trineutron
|
| 提出日時 | 2023-09-29 03:14:24 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 400 ms |
| コード長 | 952 bytes |
| コンパイル時間 | 2,125 ms |
| コンパイル使用メモリ | 198,800 KB |
| 実行使用メモリ | 24,504 KB |
| スコア | 34,387 |
| 平均クエリ数 | 52.00 |
| 最終ジャッジ日時 | 2023-10-01 12:32:59 |
| 合計ジャッジ時間 | 9,827 ms |
|
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
| 純コード判定しない問題か言語 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 100 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
constexpr int T = 52, N = 10;
int convert(int x) {
const int r = x % 10;
if (r == 0) return x;
if (r <= 3) return x + 3 - r;
if (r <= 6) return x + 6 - r;
return x + 10 - r;
}
int main() {
int t, n, money;
cin >> t >> n >> money;
money /= 500;
array<int, N> s, p, r;
s.fill(0);
p.fill(0);
r.fill(0);
for (int week = 0; week < T; week++) {
cout << 1;
for (int i = 0; i < 10; i++) {
cout << ' '
<< min(money / 10,
max(0,
convert(1.5 * pow(1.05, 3 * p.at(i))) - r.at(i)));
}
cout << endl;
cin >> money;
money /= 500;
for (auto &&x : s) {
cin >> x;
}
for (auto &&x : p) {
cin >> x;
}
for (auto &&x : r) {
cin >> x;
}
}
return 0;
}
trineutron