結果
問題 |
No.9 モンスターのレベル上げ
|
ユーザー |
|
提出日時 | 2014-12-17 03:13:27 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 483 ms / 5,000 ms |
コード長 | 399 bytes |
コンパイル時間 | 1,772 ms |
コンパイル使用メモリ | 165,968 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-23 22:06:37 |
合計ジャッジ時間 | 6,250 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include<bits/stdc++.h> #define REP(i,n)for(int i=0;i<n;++i) using namespace std;int N,A[1501],B[1501],v=1e9;int main(){priority_queue<pair<int,int>>p;cin>>N;REP(i,N){cin>>A[i];p.push(make_pair(-A[i],0));}REP(i,N)cin>>B[i];REP(i,N){auto q=p;REP(j,N)q.push(make_pair(q.top().first-B[(i+j)%N]/2,q.top().second-1)),q.pop();int w=0;while(q.size())w=max(w,-q.top().second),q.pop();v=min(v,w);}cout<<v;}