結果

問題 No.9 モンスターのレベル上げ
ユーザー itezpaceitezpace
提出日時 2016-12-06 07:23:05
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 696 bytes
コンパイル時間 675 ms
コンパイル使用メモリ 71,696 KB
実行使用メモリ 7,496 KB
最終ジャッジ日時 2023-08-18 18:29:36
合計ジャッジ時間 7,490 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<pair<int,int>> v1(N);
  int A;
  for(int i=0;i<N;++i){
    cin>>A;
    v1[i].first=A;
    v1[i].second=0;
  }
  vector<int> v2(N);
  for(int i=0;i<N;++i){
    cin>>v2[i];
  }
  int x=INT_MAX;
  for(int i=0;i<N;++i){
    rotate(v2.begin(),v2.begin()+i,v2.end());
    vector<pair<int,int>> v3=v1;
    for(int j=0;j<N;++j){
      sort(v3.begin(),v3.end());
      int a=(v2[j]/2);
      v3[0].first+=a;
      v3[0].second+=1;
    }
    int y=0;
    for(int j=0;j<N;++j){
      int b=v3[j].second;
      if(y<b) y=b;
    }
    if(x>y) x=y;
  }
  cout<<x<<endl;
}
0