結果
問題 |
No.9 モンスターのレベル上げ
|
ユーザー |
|
提出日時 | 2015-04-22 04:22:10 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 769 bytes |
コンパイル時間 | 1,299 ms |
コンパイル使用メモリ | 164,204 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 00:04:17 |
合計ジャッジ時間 | 5,847 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 WA * 6 |
ソースコード
#include "bits/stdc++.h" using namespace std; typedef long long Int; #define REP(i,n) for(int (i)=0;(i)<(int)(n);++(i)) int A[1500]; int B[1500]; int main() { int N; cin >> N; REP(i, N) cin >> A[i]; REP(i, N) cin >> B[i]; int ans = 999999999; REP(i, N) { priority_queue<pair<int, int>> pq; REP(j, N) { if (i == j) { pq.push(make_pair(-(A[j] + B[0]/2), -1)); } else { pq.push(make_pair(-A[j], 0)); } } for (int j = 1; j < N; j++) { pair<int,int> top = pq.top(); pq.pop(); top.first -= B[j] / 2; top.second--; pq.push(top); } int maxButtle = 0; while (!pq.empty()) { int buttle = -pq.top().second; pq.pop(); maxButtle = max(maxButtle, buttle); } ans = min(ans, maxButtle); } cout << ans << endl; }