結果
| 問題 |
No.9 モンスターのレベル上げ
|
| ユーザー |
|
| 提出日時 | 2022-03-08 18:55:47 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 701 bytes |
| コンパイル時間 | 4,276 ms |
| コンパイル使用メモリ | 253,980 KB |
| 最終ジャッジ日時 | 2025-01-28 07:46:52 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 WA * 6 |
ソースコード
#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();
}