結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
spade630
|
| 提出日時 | 2015-10-18 00:33:43 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 293 ms / 5,000 ms |
| コード長 | 1,263 bytes |
| 記録 | |
| コンパイル時間 | 808 ms |
| コンパイル使用メモリ | 106,444 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-09 06:33:27 |
| 合計ジャッジ時間 | 3,684 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <time.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FFOR(i,a,b) for(int i=(a);i<=(b);i++)
#define REP(i,b) FOR(i,0,b)
#define RREP(i,b) FFOR(i,1,b)
#define PB push_back
#define F first
#define S second
#define BE(c) c.begin(),c.end()
using namespace std;
typedef long long LL;
typedef int ut;
typedef long double ld;
typedef pair<ut,ut> pr;
typedef vector<pr> Vpr;
typedef vector<ut> VI;
typedef pair<ut,pr> ppr;
typedef priority_queue<pr,Vpr, greater<pr> > PQ;
const int SIZE=1e+5 + 1;
const ut INF=1<<30;
const ld eps=1e-6;
const LL mod=1e+9 + 7;
int main() {
int n;
cin >> n;
int a, b[2048];
PQ base;
REP(i,n){
scanf("%d", &a);
base.push(pr(a, 0));
}
REP(i,n){
scanf("%d", &b[i]);
}
int ans = INF;
REP(i,n){
PQ que = base;
int now = i;
for(int j = 0; j < n; ++j, now++){
if(now >= n)
now -= n;
pr p = que.top(); que.pop();
que.push(pr(p.F + b[now] / 2, p.S + 1));
}
int res = 0;
while(!que.empty()){
pr p = que.top(); que.pop();
res = max(res, p.S);
}
ans = min(ans, res);
}
cout << ans << endl;
return 0;
}
spade630