結果
問題 |
No.9 モンスターのレベル上げ
|
ユーザー |
![]() |
提出日時 | 2018-11-02 00:58:55 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 994 bytes |
コンパイル時間 | 1,804 ms |
コンパイル使用メモリ | 203,552 KB |
最終ジャッジ日時 | 2025-01-06 15:21:39 |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 WA * 14 |
ソースコード
#include <bits/stdc++.h> using namespace std; using i64 = int64_t; using vi = vector<i64>; using vvi = vector<vi>; int main() { int n; cin >> n; using ii = pair<int, int>; priority_queue<ii, vector<ii>, greater<ii>> que; for (int i = 0; i < n; i++) { int a; cin >> a; que.push(ii(a, 0)); } deque<int> bs; for (int i = 0; i < n; i++) { int b; cin >> b; bs.push_back(b); } int ans = -1; for (int i = 0; i < n; i++) { priority_queue<ii, vector<ii>, greater<ii>> q(que); for (int j = 0; j < n; j++) { ii m = q.top(); q.pop(); m.first += bs[j] / 2; m.second++; q.push(m); } int tmp = -1; while (q.size()) { tmp = max(tmp, q.top().second); q.pop(); } ans = max(ans, tmp); bs.push_back(bs.front()); bs.pop_front(); } cout << ans << endl; }