結果

問題 No.9 モンスターのレベル上げ
ユーザー かにかに
提出日時 2015-11-20 01:14:24
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,785 bytes
コンパイル時間 1,320 ms
コンパイル使用メモリ 154,708 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-11 18:08:05
合計ジャッジ時間 7,020 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 364 ms
4,348 KB
testcase_12 AC 296 ms
4,348 KB
testcase_13 AC 212 ms
4,348 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
#define aLL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXISt(s,e) ((s).find(e)!=(s).end())
#define INF 1<<25
#define MAX 100000000
#define pb push_back
#define mp make_pair
using namespace std;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef pair<pair<int, int>, int> pp;
typedef long long ll;
int dx[] = { 0, 1, 0, -1 };
int dy[] = { -1, 0, 1, 0 };

int sttoi(std::string str) {
	int ret;
	std::stringstream ss; ss << str;
	ss >> ret;
	return ret;
}

bool sort_greater(const pair<string, int> &a, const pair<string, int> &b) {
	return a.second > b.second;
}
int gcd(int a, int b){
	if (b > a)swap(a, b);if (b == 0)return a;else{return gcd(b, a%b);}
}

void solve() {
	int n;
	cin >> n;
	vector<int> me;
	vector<int> enemy;
	rep(i, n){
		int a;
		cin >> a;
		me.push_back(a);
	}
	rep(i, n){
		int a;
		cin >> a;
		enemy.push_back(a);
	}
	int maxi = -1;
	rep(i, enemy.size()){
		priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > > copy;
		rep(j, me.size()){
			copy.push(make_pair(me[j], 0));
		}
		REP(j, i, enemy.size()){
			pair<int, int> p = copy.top();
			copy.pop();
			int e = enemy[j];
			copy.push(make_pair(p.first + (e / 2), p.second + 1));
		}
		REP(j, 0, i){
			pair<int, int> p = copy.top();
			copy.pop();
			int e = enemy[j];
			copy.push(make_pair(p.first + (e / 2), p.second + 1));
		}
		while (!copy.empty()){
			pair<int, int> p = copy.top();
			copy.pop();
			maxi = max(maxi, p.second);
		}
	}
	P(maxi);
}

int main() {
	solve();
	return 0;
}
0