結果

問題 No.9 モンスターのレベル上げ
ユーザー KudeKude
提出日時 2020-09-03 08:11:24
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 890 bytes
コンパイル時間 1,885 ms
コンパイル使用メモリ 176,368 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-14 18:45:19
合計ジャッジ時間 5,849 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 304 ms
4,384 KB
testcase_03 WA -
testcase_04 AC 128 ms
4,384 KB
testcase_05 WA -
testcase_06 AC 29 ms
4,380 KB
testcase_07 AC 3 ms
4,380 KB
testcase_08 AC 40 ms
4,384 KB
testcase_09 AC 296 ms
4,384 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 255 ms
4,380 KB
testcase_12 AC 195 ms
4,384 KB
testcase_13 AC 256 ms
4,380 KB
testcase_14 AC 298 ms
4,384 KB
testcase_15 AC 272 ms
4,380 KB
testcase_16 AC 5 ms
4,384 KB
testcase_17 AC 176 ms
4,384 KB
testcase_18 AC 147 ms
4,380 KB
testcase_19 AC 4 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<VI>;

int main() {
    int n;
    cin >> n;
    VI a(n), b(n);
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> b[i];
    int ans = n;
    rep(s, n) {
        priority_queue<tuple<int, int, int>> q;
        rep(i, n) q.emplace(-a[i], 1, i);
        VI cnt(n);
        rep(j, n) {
            int ai, last, i;
            tie(ai, last, i) = q.top(); q.pop();
            ai = -ai;
            cnt[i] += 1;
            ai += b[(s + j) % n] / 2;
            q.emplace(-ai, -j, i);
        }
        int mx = 0;
        rep(i, n) chmax(mx, cnt[i]);
        chmin(ans, mx);
    }
    cout << ans << endl;
}
0