# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
624301 | Jomnoi | Distributing Candies (IOI21_candies) | C++17 | 1849 ms | 43192 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>
#include "candies.h"
using namespace std;
const int MAX_N = 2e5 + 5;
const int MAX_Q = 2e5 + 5;
const long long INF = 1e18 + 7;
int N, Q;
vector <int> S;
vector <pair <int, int>> queries[MAX_N];
struct Node {
long long mn, mx;
Node() : mn(0), mx(0) {}
Node(long long n, long long x) : mn(n), mx(x) {}
Node operator+(const Node &o) const {
return Node(min(mn, o.mn), max(mx, o.mx));
}
}tree[4 * MAX_Q];
long long lazy[4 * MAX_Q];
void push(int idx, int l, int r) {
if(lazy[idx] != 0) {
tree[idx].mn += lazy[idx];
tree[idx].mx += lazy[idx];
if(l != r) {
lazy[idx * 2] += lazy[idx];
# | 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... |