제출 #528370

#제출 시각아이디문제언어결과실행 시간메모리
528370Hydrolyzed쌀 창고 (IOI11_ricehub)C++14
100 / 100
13 ms1740 KiB
/*
 * AUTHOR	: Hydrolyzed~
 * SCHOOL	: RYW
 * TASK		:
 * ALGO		:
 * DATE		:
 * */

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>

#ifndef _DEBUG
// @==== Libary ====@ //
#include "ricehub.h"
// @================@ //
#endif

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update> ;

// @=== Debugger ===@ //
#ifdef _DEBUG
#include "debug.hpp"
#else
#define dbg(...) 0
#endif
// @================@ //

using ll = long long;

int besthub(int n, int L, int x[], long long b){
	int res = 0;
	for(int i=0, j=0; j<n; ++j){
		b -= x[j] - x[(i + j) >> 1];
		while(b < 0){
			b += x[(i + j + 1) >> 1] - x[i];
			i++;
		}
		res = max(res, j - i + 1);
	}
	return res;
}

// https://github.com/MasterIceZ/archive/tree/main/cpp-template
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...