結果
| 問題 |
No.9 モンスターのレベル上げ
|
| コンテスト | |
| ユーザー |
Sounds_Of_Rain
|
| 提出日時 | 2015-07-21 11:04:58 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 897 bytes |
| コンパイル時間 | 914 ms |
| コンパイル使用メモリ | 77,536 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-08 11:31:27 |
| 合計ジャッジ時間 | 1,977 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 18 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <queue>
#include <cmath>
using namespace std;
const int INF=1000000;
const int MOD = 100000;
typedef long long int llint;
int main(){
int n, ans = INF;
int A[15000];
int B[15000];
priority_queue<pair<int, int>> a;
cin >> n;
for (int i = 0; i < n; i++){
cin >> A[i];
a.push(make_pair(-A[i], 0));
}
for (int i = 0; i < n; i++){
cin >> B[i];
}
for (int i = 0; i < n; i++){
int cc = 0;
priority_queue<pair<int, int>>b = a;
for (int j = i; j < n; j++){
pair<int, int>P = b.top();
b.pop();
if (j < n){
P.first -= B[j] / 2;
}
else{ P.first -= B[j - n]/2; }
P.second--;
b.push(P);
cc = max(cc, -P.second);
}
ans = min(ans, cc);
}
cout << ans << endl;
return 0;
}
Sounds_Of_Rain