結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
assy1028
|
| 提出日時 | 2015-03-20 21:49:50 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 200 ms / 5,000 ms |
| コード長 | 1,136 bytes |
| 記録 | |
| コンパイル時間 | 808 ms |
| コンパイル使用メモリ | 110,520 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-09 06:12:38 |
| 合計ジャッジ時間 | 3,160 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <complex>
#include <string.h>
using namespace std;
#define endl '\n'
#define all(v) (v).begin(), (v).end()
#define uniq(v) (v).erase(unique((v).begin(), (v).end()), (v).end())
typedef long long ll;
typedef pair<int, int> P;
typedef unsigned int uint;
const int inf = 1000000009;
int main() {
int n;
scanf("%d", &n);
priority_queue<P, vector<P>, greater<P> > t_que;
vector<int> bs(2*n);
for (int i = 0; i < n; i++) {
int a;
scanf("%d", &a);
t_que.push(P(a, 0));
}
for (int i = 0; i < n; i++) {
int b;
scanf("%d", &b);
bs[i] = bs[i+n] = b;
}
int res = inf;
for (int i = 0; i < n; i++) {
priority_queue<P, vector<P>, greater<P> > que = t_que;
int maxi = 0;
for (int j = i; j < i + n; j++) {
P p = que.top(); que.pop();
p.first += bs[j]/2;
p.second++;
maxi = max(maxi, p.second);
que.push(p);
}
res = min(res, maxi);
}
printf("%d\n", res);
}
assy1028