# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
806813 | Gangsta | 쌀 창고 (IOI11_ricehub) | C++14 | 19 ms | 2736 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// a >> b = a / pow(2,b)
// a << b = a * pow(2,b)
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define sz size()
#define ss second
#define ff first
#define N 200001
#define pll pair<ll,ll>
using namespace std;
bool check(int md, ll b, vector<int>arr){
int n = arr.sz, p = (md-1) / 2;
ll cost = 0;
for(int i = 0; i < md; i++) cost += abs(arr[p] - arr[i]);
if(cost <= b) return true;
for(int i = md; i < n; i++){
int x = arr[i - md], y = arr[i];
int m = arr[p], mp = arr[p+1];
p++;
if(md&1){
cost += x + y;
cost -= m + mp;
}
else{
cost += x + y;
cost -= mp + mp;
}
# | 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... |