# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
908044 | Trisanu_Das | New Home (APIO18_new_home) | C++17 | 1606 ms | 66092 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 ll long long
const int inf = 1e8;
using namespace std;
int x[310005], t[610005], st[1210005], ans[310005];
vector<array<int, 2>> v1[310005];
array<int, 4> v2[1210005];
array<int, 3> qa[310005];
struct comp {
bool operator () (const int &a, const int &b) const {
if (x[a] == x[b])
return a < b;
return x[a] < x[b];
}
};
map<int, int, comp> mp;
int u2 = 0, n, k, q;
void calc() {
int i;
for (i = 0; i < k; i++) {
mp[n + 1] = 0;
for (auto it : v1[i]) {
auto it1 = mp.upper_bound(it[1]), it2 = it1--;
v2[u2++] = {(x[it1->first] + x[it2->first] + 1) / 2, x[it2->first], it2->second, it[0]};
it2->second = it[0];
if (it1->first == it[1]) {
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |