# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
237004 | DodgeBallMan | Cake 3 (JOI19_cake3) | C++14 | 1139 ms | 113180 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>
#define pii pair<long long, long long>
#define x first
#define y second
using namespace std;
const int N = 2e5 + 10;
int n, m, ver[N];
pii cake[N];
vector<long long> t, coord;
vector<int> sz, L, R;
unordered_map<long long, int> mp;
long long ans[N], ret = -2e18;
int newleaf( long long va, int ss ) {
t.emplace_back( va ), sz.emplace_back( ss ), L.emplace_back( -1 ), R.emplace_back( -1 );
return (int)t.size() - 1;
}
int newpar( int l, int r ) {
t.emplace_back( t[l] + t[r] ), sz.emplace_back( sz[l] + sz[r] );
L.emplace_back( l ), R.emplace_back( r );
return (int)t.size() - 1;
}
int get( long long x ) {
mp[x]++;
return lower_bound( coord.begin(), coord.end(), x ) - coord.begin() + mp[x];
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... |