답안 #707310

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
707310 2023-03-08T18:33:01 Z mseebacher 쌀 창고 (IOI11_ricehub) C++17
컴파일 오류
0 ms 0 KB
//#include <bits/stdc++.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <functional>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

#define mp make_pair
#define f first
#define s second
#define pb push_back

typedef long long ll;
typedef long double lld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;

const lld pi = 3.14159265358979323846;

#define MAXI (int)2e5+5

int besthub(int r,int l,ll b,int x[]){
	int ans = 0;
	for(int i = 0;i<r;i++){
		for(int j = i+1;j<r;j++){
			ll cost = 0;
			for(int h = i;h<=j;h++){
				int mid = (i+j) >> 1;
				cost += abs(x[mid]-x[h]);
			}
			if(cost < b) ans = max(j-i+1,ans);
		}
	}
	
	return ans;
}

Compilation message

/usr/bin/ld: /tmp/ccb9oxcO.o: in function `main':
grader.cpp:(.text.startup+0xae): undefined reference to `besthub(int, int, int*, long long)'
collect2: error: ld returned 1 exit status