# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
48960 | erdemkiraz | New Home (APIO18_new_home) | C++11 | 5029 ms | 181084 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 < int, int > ii;
const int N = 3e5 + 5;
const int OUT = 0, QUE = 1;
const int addPositive = 0, addNegative = 1;
int n, q, k, total;
int ans[N];
map < int, int > s[N];
int z, g;
int tree[2][N << 1];
int curX;
vector < pair < int, pair < int*, int > > > changes;
void update(int t, int l, int r, int x) {
for(l += N, r += N; l <= r; l = (l + 1) >> 1, r = (r - 1) >> 1) {
if((l & 1) and x > tree[t][l]) {
changes.push_back({curX, {&tree[t][l], tree[t][l]}});
tree[t][l] = x;
}
if((~r & 1) and x > tree[t][r]) {
changes.push_back({curX, {&tree[t][r], tree[t][r]}});
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... |