結果

問題 No.9 モンスターのレベル上げ
ユーザー なおなお
提出日時 2014-12-17 03:13:27
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 417 ms / 5,000 ms
コード長 399 bytes
コンパイル時間 1,296 ms
コンパイル使用メモリ 149,916 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-06 03:15:04
合計ジャッジ時間 5,842 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 417 ms
4,376 KB
testcase_03 AC 333 ms
4,376 KB
testcase_04 AC 174 ms
4,380 KB
testcase_05 AC 114 ms
4,376 KB
testcase_06 AC 38 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 52 ms
4,376 KB
testcase_09 AC 400 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 325 ms
4,376 KB
testcase_12 AC 257 ms
4,380 KB
testcase_13 AC 201 ms
4,376 KB
testcase_14 AC 402 ms
4,380 KB
testcase_15 AC 370 ms
4,376 KB
testcase_16 AC 7 ms
4,376 KB
testcase_17 AC 232 ms
4,376 KB
testcase_18 AC 197 ms
4,380 KB
testcase_19 AC 5 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;}
0