# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1004679 | hacizadal | 쌀 창고 (IOI11_ricehub) | C++17 | 25 ms | 3028 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ricehub.h"
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define pll pair<ll, ll>
int besthub(int n, int l, int a[], long long b)
{
// 0 1 2 3 4 5
ll x = 0;
if (n%2==0){
x = a[n/2] + a[n/2-1];
x /= 2;
}
else {
x = a[n/2];
}
vector<ll>v;
for (ll i = 0; i<n; i++){
v.push_back(abs(x-a[i]));
}
sort(v.begin(), v.end());
ll sum = 0, cnt = 0;
for (ll j = 0; j<v.size(); j++){
sum += v[j];
cnt++;
if (sum > b){
cnt--;
break;
}
}
return cnt;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |