結果

問題 No.9 モンスターのレベル上げ
ユーザー femtofemto
提出日時 2016-09-22 20:57:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 902 bytes
コンパイル時間 882 ms
コンパイル使用メモリ 96,404 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-28 18:29:17
合計ジャッジ時間 5,353 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 428 ms
6,940 KB
testcase_03 WA -
testcase_04 AC 160 ms
6,944 KB
testcase_05 AC 102 ms
6,940 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 372 ms
6,944 KB
testcase_12 WA -
testcase_13 AC 221 ms
6,944 KB
testcase_14 AC 415 ms
6,940 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 230 ms
6,940 KB
testcase_18 AC 186 ms
6,940 KB
testcase_19 AC 5 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <cassert>
#include <functional>
#include <queue>
using namespace std;
typedef pair<int, int> Pii;

int A[1500];
int B[1500];

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N;
	cin >> N;
	for(int i = 0; i < N; i++) {
		cin >> A[i];
	}
	for(int i = 0; i < N; i++) {
		cin >> B[i];
	}

	int ans = 1 << 25;
	for(int s = 0; s < N; s++) {
		priority_queue < Pii, vector<Pii>, greater<Pii> > q;
		for(int i = 0; i < N; i++) {
			q.push(Pii(A[i], 0));
		}

		int m = s;
		for(int i = 0; i < N; i++) {
			Pii p = q.top();
			q.pop();
			p.first += B[m] / 2;
			p.second++;
			q.push(p);
			m++;
		}
		int max_c = 0;
		for(int i = 0; i < N; i++) {
			max_c = max(max_c, q.top().second);
			q.pop();
		}
		ans = min(ans, max_c);
	}

	cout << ans << endl;
}
0