# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
716704 | Sohsoh84 | Candies (JOI18_candies) | C++17 | 762 ms | 16364 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;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(),(x).end()
#define X first
#define Y second
#define sep ' '
#define endl '\n'
#define debug(x) cerr << #x << ": " << x << endl;
const ll MAXN = 1e6 + 10;
ll n, A[MAXN];
vector<ll> merge_divide(vector<ll> a, vector<ll> b) {
vector<ll> ans;
int ap = 0, bp = 0, as = a.size(), bs = b.size();
ll f = 0;
ans.push_back(f);
while (ap + 1 < as || bp + 1 < bs) {
if (ap + 1 >= as || (bp + 1 < bs && a[ap + 1] - a[ap] < b[bp + 1] - b[bp])) {
f += b[bp + 1] - b[bp];
bp++;
} else {
f += a[ap + 1] - a[ap];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |