結果

問題 No.9 モンスターのレベル上げ
コンテスト
ユーザー moyashi_senpai
提出日時 2016-08-19 09:13:01
言語 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  
実行時間 -
コード長 917 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 950 ms
コンパイル使用メモリ 107,580 KB
実行使用メモリ 7,976 KB
最終ジャッジ日時 2026-05-08 03:04:43
合計ジャッジ時間 2,763 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_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;
			pii cur = party.top();
			cur = { cur.first + (int) (b[num] / 2), cur.second + 1 };
			ans = max(ans, cur.second);
			party.pop();
			party.push(cur);
		}
	}

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