結果

問題 No.9 モンスターのレベル上げ
ユーザー momoyuumomoyuu
提出日時 2022-08-24 00:45:02
言語 C++23(draft)
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 404 ms / 5,000 ms
コード長 1,475 bytes
コンパイル時間 3,116 ms
コンパイル使用メモリ 283,308 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-19 14:40:28
合計ジャッジ時間 7,410 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 404 ms
6,944 KB
testcase_03 AC 320 ms
6,940 KB
testcase_04 AC 169 ms
6,944 KB
testcase_05 AC 111 ms
6,944 KB
testcase_06 AC 37 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 51 ms
6,944 KB
testcase_09 AC 398 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 341 ms
6,944 KB
testcase_12 AC 267 ms
6,940 KB
testcase_13 AC 215 ms
6,940 KB
testcase_14 AC 404 ms
6,940 KB
testcase_15 AC 364 ms
6,944 KB
testcase_16 AC 7 ms
6,940 KB
testcase_17 AC 232 ms
6,944 KB
testcase_18 AC 191 ms
6,940 KB
testcase_19 AC 5 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
template<class t> using vc = vector<t>;
template<class t> using vvc = vc<vc<t>>;
using pi = pair<int,int>;
using vi = vc<int>;
using vvi = vvc<int>;

#define rep(i,a,b) for (int i = a; i < b; i++)
#define irep(i,a,b) for (int i = a; i > b; i--)
#define print(n) cout << n << endl
#define pritn(n) print(n)
#define rup(a,b) (a+b-1)/b
#define input(A,N) rep(i,0,N) cin>>A[i];


int main(){
    cout << fixed << setprecision(15);
    
    int n;
    cin >> n;
    vc<ll> a(n);
    vc<ll> b(n);
    input(a,n);
    input(b,n);
    ll ans = n;
    auto val = [](pair<ll,ll> &a, pair<ll,ll> &b){
        if (a.first==b.first) return a.second>b.second;
        else return a.first > b.first;
    };
    rep(i,0,n){
        priority_queue<pair<ll,ll>,vc<pair<ll,ll>>,greater<pair<ll,ll>>> que;
        rep(j,0,n){
            que.push(pair<ll,ll>(a[j],0));
        }
        ll count = 0;
        rep(j,0,n){
            pair<ll,ll> now = que.top();
            que.pop();
            now.first += b[(i+j)%n]/2;
            now.second ++;
            que.push(now);
        }
        rep(j,0,n){
            pair<ll,ll> now = que.top();
            que.pop();
            //cout<<now.first<<" "<<now.second<<endl;
            count = max(count,now.second);
        }
        ans = min(count,ans);
    }
    print(ans);
    //system("pause");
    return 0;
}
0