結果
| 問題 |
No.484 収穫
|
| コンテスト | |
| ユーザー |
sugim48
|
| 提出日時 | 2017-03-05 03:47:49 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,512 bytes |
| コンパイル時間 | 1,211 ms |
| コンパイル使用メモリ | 103,428 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-23 02:20:03 |
| 合計ジャッジ時間 | 12,556 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 WA * 3 |
ソースコード
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#include <random>
#include <fstream>
using namespace std;
#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<int, ll> i_ll;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int v; ll w; };
const int MOD = 1000000007;
const int _MOD = 1000000009;
double EPS = 1e-10;
const ll INF = LLONG_MAX / 10;
int main() {
int N; cin >> N;
vector<int> a(N);
rep(i, N) cin >> a[i];
if (N == 1) {
cout << a[0] << endl;
return 0;
}
int lb = -1, ub = 1010000000;
while (ub - lb > 1) {
int mid = (lb + ub) / 2;
bool ok = false;
rep(k0, N * 2 - 2) {
vector<int> b(N, -1);
rep(t, N * 2 - 2) {
int k = k0 + t;
int i;
if (k < N - 1) i = k;
else if (k < N * 2 - 2) i = N * 2 - 2 - k;
else if (k < N * 3 - 3) i = k - (N * 2 - 2);
else i = N * 4 - 4 - k;
if (b[i] == -1) b[i] = mid - t;
}
bool unko = false;
rep(i, N) if (b[i] < a[i]) unko = true;
if (!unko) ok = true;
}
if (ok) ub = mid;
else lb = mid;
}
cout << ub << endl;
}
sugim48