답안 #411556

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
411556 2021-05-25T13:50:07 Z jeqcho 쌀 창고 (IOI11_ricehub) C++17
17 / 100
1000 ms 460 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vpi;

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

#define pb push_back
#define rsz resize
#define sz(x) int(x.size())
#define all(x) begin(x), end(x)
#define fi first

// subtask 1,2,3

int besthub(int R, int L, int X[], ll B){
	int mx=0;
	FOR(len,1,R)
	{
		F0R(i,R)
		{
			int las = i+len-1;
			if(las>=R)break;
			int mid = (i+las)/2;
			ll cur=0;
			FOR(j,i,las+1)
			{
				cur += abs(X[j]-X[mid]);
			}
			if(cur<=B)
			{
				mx=max(mx,len);
			}
		}
	}
	return mx;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 308 KB Output is correct
2 Correct 1 ms 224 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 204 KB Output is correct
2 Correct 2 ms 304 KB Output is correct
3 Incorrect 136 ms 304 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1078 ms 460 KB Time limit exceeded
2 Halted 0 ms 0 KB -