結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-06-14 21:22:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 999 bytes |
| コンパイル時間 | 1,894 ms |
| コンパイル使用メモリ | 173,440 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-09 13:43:06 |
| 合計ジャッジ時間 | 5,134 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 WA * 6 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;
typedef long long int ll;
int calc(vector<int> &ev,vector<int> &mv,int offset){
priority_queue<pair<int,int>> pq;
for (int e:mv)
pq.push(make_pair(-e,0));
int i,j,max=0;
for (j=0;j<ev.size();j++){
i=(j+offset)%ev.size();
int p=-pq.top().first;
int q=-pq.top().second;pq.pop();
p+=ev[i]/2;
if (max<++q) max=q;
pq.push(make_pair(-p,-q));
}
return max;
}
int main(){
int i,j,k,l;
int x,y,d;
int n,m;
cin >> n;
vector<int> mee(n);
vector<int> ene(n);
for (i=0;i<n;i++){
scanf("%d",&j);
mee[i]=j;
}
for (i=0;i<n;i++){
scanf("%d",&j);
ene[i]=j;
}
int min=0xFFFF;
for (i=0;i<n;i++){
int u=calc(mee,ene,i);
if (min>u) min=u;
}
cout<<min<<endl;
return 0;
}