結果
問題 | No.9 モンスターのレベル上げ |
ユーザー | kotatsugame |
提出日時 | 2019-10-14 02:30:19 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 422 ms / 5,000 ms |
コード長 | 557 bytes |
コンパイル時間 | 785 ms |
コンパイル使用メモリ | 74,968 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-08-23 07:40:04 |
合計ジャッジ時間 | 5,277 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,376 KB |
testcase_01 | AC | 1 ms
4,384 KB |
testcase_02 | AC | 422 ms
4,380 KB |
testcase_03 | AC | 339 ms
4,376 KB |
testcase_04 | AC | 175 ms
4,376 KB |
testcase_05 | AC | 114 ms
4,376 KB |
testcase_06 | AC | 40 ms
4,376 KB |
testcase_07 | AC | 2 ms
4,380 KB |
testcase_08 | AC | 53 ms
4,376 KB |
testcase_09 | AC | 417 ms
4,380 KB |
testcase_10 | AC | 1 ms
4,380 KB |
testcase_11 | AC | 347 ms
4,376 KB |
testcase_12 | AC | 278 ms
4,376 KB |
testcase_13 | AC | 201 ms
4,380 KB |
testcase_14 | AC | 418 ms
4,376 KB |
testcase_15 | AC | 376 ms
4,376 KB |
testcase_16 | AC | 7 ms
4,376 KB |
testcase_17 | AC | 243 ms
4,376 KB |
testcase_18 | AC | 201 ms
4,380 KB |
testcase_19 | AC | 4 ms
4,376 KB |
コンパイルメッセージ
main.cpp:6:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type] 6 | main() | ^~~~
ソースコード
#include<iostream> #include<queue> using namespace std; int N; int A[1500],B[1500]; main() { cin>>N; for(int i=0;i<N;i++)cin>>A[i]; for(int i=0;i<N;i++)cin>>B[i]; int ans=1e9; for(int i=0;i<N;i++) { priority_queue<pair<int,int> >P; for(int j=0;j<N;j++)P.push(make_pair(-A[j],0)); for(int j=0;j<N;j++) { pair<int,int>p=P.top();P.pop(); p.first-=B[(i+j)%N]/2; p.second-=1; P.push(p); } int now=0; while(!P.empty()) { if(now<-P.top().second)now=-P.top().second; P.pop(); } if(ans>now)ans=now; } cout<<ans<<endl; }