結果

問題 No.9 モンスターのレベル上げ
コンテスト
ユーザー moyashi_senpai
提出日時 2016-08-19 09:06:49
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 900 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 945 ms
コンパイル使用メモリ 107,136 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-05-08 03:04:30
合計ジャッジ時間 3,199 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#define REP(i,n) for(int i = 0; n > i; i++)

using namespace std;
typedef vector<int> Ivec;
typedef pair<int, int> pii;

int main() {
	int n;
	scanf("%d", &n);
	priority_queue<pii, vector<pii>, greater<pii>> a;
	vector<int> b(n);
	REP(i, n) {
		int x;
		scanf("%d", &x);
		a.push({ x,0 });
	}
	REP(i, n) scanf("%d", &b[i]);
	int ans = 0;
	REP(i, n) {
		priority_queue<pii, vector<pii>, greater<pii>> party = a;
		for(int j = 0; n > j; j++) {
			int num = (i + j)%n;
			ans = max(ans, party.top().second + 1);
			party.push({party.top().first + (int)(b[num]/2), party.top().second + 1});
			party.pop();
		}
	}

	printf("%d\n", ans);
	return 0;
}
0