結果

問題 No.484 収穫
ユーザー sugim48sugim48
提出日時 2017-03-05 03:47:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,512 bytes
コンパイル時間 997 ms
コンパイル使用メモリ 103,476 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-05 05:53:33
合計ジャッジ時間 16,256 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,384 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 14 ms
4,384 KB
testcase_10 AC 14 ms
4,380 KB
testcase_11 AC 14 ms
4,376 KB
testcase_12 AC 1,178 ms
4,504 KB
testcase_13 AC 1,174 ms
4,380 KB
testcase_14 AC 1,175 ms
4,376 KB
testcase_15 AC 1,170 ms
4,380 KB
testcase_16 AC 1,188 ms
4,380 KB
testcase_17 AC 1,180 ms
4,380 KB
testcase_18 AC 1,180 ms
4,380 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 1,172 ms
4,380 KB
testcase_23 AC 1,171 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0