結果

問題 No.9 モンスターのレベル上げ
ユーザー ttkkggwwttkkggww
提出日時 2022-03-08 18:55:47
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 701 bytes
コンパイル時間 4,548 ms
コンパイル使用メモリ 264,636 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-10-01 01:25:16
合計ジャッジ時間 11,170 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 644 ms
4,376 KB
testcase_03 WA -
testcase_04 AC 263 ms
4,380 KB
testcase_05 AC 172 ms
4,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 618 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 433 ms
4,380 KB
testcase_12 WA -
testcase_13 AC 440 ms
4,380 KB
testcase_14 AC 621 ms
4,376 KB
testcase_15 AC 567 ms
4,380 KB
testcase_16 WA -
testcase_17 AC 361 ms
4,376 KB
testcase_18 AC 302 ms
4,376 KB
testcase_19 AC 5 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#include<atcoder/all>
using namespace atcoder;
using ll = long long;
int n;
vector<int> a,b;
using P = pair<int,int>;

void solve(){
	int out = n;
	for(int i = 0;i<n;i++){
		multiset<P> mst;
		for(auto &j:a)mst.emplace(j,0);
		for(int j = 0;j<n;j++){
			auto it = mst.begin();
			auto p = *it;
			mst.erase(it);
			p.second++;
			p.first += b[i+j]/2;
			mst.insert(p);
		}
		int ans = 0;
		for(auto &j:mst)ans = max(ans,j.second);
		out = min(ans,out);
	}
	cout<<out<<endl;
}

signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cin >> n;
	a = vector<int>(n);
	b = vector<int>(n);
	for(auto &i:a)cin >> i;
	for(auto &i:b)cin >> i;
	solve();
}
0