結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 414 ms
4,380 KB
testcase_03 AC 333 ms
4,376 KB
testcase_04 AC 173 ms
4,376 KB
testcase_05 AC 113 ms
4,380 KB
testcase_06 AC 38 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 51 ms
4,380 KB
testcase_09 AC 399 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 324 ms
4,376 KB
testcase_12 AC 256 ms
4,376 KB
testcase_13 AC 198 ms
4,376 KB
testcase_14 AC 398 ms
4,376 KB
testcase_15 AC 366 ms
4,376 KB
testcase_16 AC 7 ms
4,376 KB
testcase_17 AC 229 ms
4,380 KB
testcase_18 AC 198 ms
4,380 KB
testcase_19 AC 5 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define R(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;R(i,N){cin>>A[i];p.push(make_pair(-A[i],0));}R(i,N)cin>>B[i];R(i,N){auto q=p;R(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