結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
tottoripaper
|
| 提出日時 | 2014-11-16 03:16:02 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 255 ms / 5,000 ms |
| コード長 | 1,043 bytes |
| 記録 | |
| コンパイル時間 | 438 ms |
| コンパイル使用メモリ | 69,492 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-09 05:56:53 |
| 合計ジャッジ時間 | 3,314 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <cstdio>
#include <vector>
#include <queue>
#define mp std::make_pair
typedef std::pair<int,int> P;
typedef std::pair<P, int> State;
int main(){
int N;
scanf("%d", &N);
int A[1500], B[1500];
for(int i=0;i<N;i++){scanf("%d", A+i);}
for(int i=0;i<N;i++){scanf("%d", B+i);}
int res = 1500;
for(int first=0;first<N;first++){
int counter[1500];
std::fill(counter, counter+1500, 0);
std::priority_queue<State, std::vector<State>, std::greater<State>> q;
for(int i=0;i<N;i++){q.push(mp(mp(A[i], 0), i));}
for(int i=0;i<N;i++){
State s = q.top(); q.pop();
int index = (first+i) % N;
q.push(mp(mp(s.first.first+B[index]/2, s.first.second+1), s.second));
counter[s.second] += 1;
}
int mx = 0;
for(int i=0;i<N;i++){
mx = std::max(mx, counter[i]);
}
res = std::min(res, mx);
}
printf("%d\n", res);
}
tottoripaper