結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
srup٩(๑`н´๑)۶
|
| 提出日時 | 2016-10-08 00:28:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 879 bytes |
| コンパイル時間 | 640 ms |
| コンパイル使用メモリ | 67,576 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-21 20:17:36 |
| 合計ジャッジ時間 | 5,189 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 WA * 5 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i,n) for(int i=0;i<(n);i++)
const int INF = 1e9;
int n;
int a[3010], b[3010];
int main(void){
cin >> n;
rep(i, n){
cin >> a[i];
a[i + n] = a[i];
}
rep(i, n){
cin >> b[i];
b[i + n] = b[i];
}
int ans = INF;
rep(i, n){
priority_queue<P, vector<P>, greater<P> > pq;
for (int j = 0; j < n; ++j){
pq.push(make_pair(a[j], 0));
}
for (int j = i; j < i + n; ++j){
int nlv = pq.top().first;
int t = pq.top().second;
pq.pop();
int lvup = a[j] / 2;
pq.push(make_pair(nlv + lvup, t + 1));
}
int tmp = 0;
while(!pq.empty()){
int t = pq.top().second; pq.pop();
tmp = max(tmp, t);
}
ans = min(ans, tmp);
}
printf("%d\n", ans);
return 0;
}
srup٩(๑`н´๑)۶