# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
592656 | 79brue | Cake 3 (JOI19_cake3) | C++17 | 1 ms | 212 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, k;
pair<ll, ll> arr[200002]; /// (C, V)
ll ans;
void updateAns(vector<ll> &vl, vector<ll> &vr){
if((int)vl.size() + (int)vr.size() < k) return;
for(int i=0; i<(int)vl.size(); i++){
int j = k - i - 2;
if(j<0 || j>=(int)vr.size()) continue;
ans = max(ans, vl[i] + vr[j]);
}
}
void updateRet(vector<ll> &ret, vector<ll> &base, vector<ll> &add){
ret.push_back(base[0]);
int lpnt = 1, rpnt = 0;
ll lval = base[0], rval = 0;
while((int)ret.size() < (int)base.size() + (int)add.size()){
if(lpnt == (int)base.size()){
rval = add[rpnt++];
}
else if(rpnt == (int)add.size()){
lval = base[lpnt++];
}
Compilation message (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... |