# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
30577 | azneye | Synchronization (JOI13_synchronization) | C++14 | 356 ms | 18236 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;
namespace {
#define VERA(i, a, b)for(auto i=(ll)(a);i<(ll)(b);++i)
#define ANDY(i, a, b)for(auto i=(ll)(a);i>(ll)(b);--i)
typedef long long ll;
typedef long double dd;
template <class T> using V = vector<T>;
// Maintain array A[0, n-1] initially all -1
// Given k, x: Set A[k] = x
// Given b, x: Find max p such that 0 <= p <= b and A[p] >= x
struct SegTree {
static const int PW = 1 << 17;
int max_val[2 * PW];
void Init() {
memset(max_val, -1, sizeof(max_val));
}
void Set(int pos, int val) {
max_val[pos += PW] = val;
for (int i = pos >> 1; i > 0; i >>= 1)
max_val[i] = max(max_val[2 * i], max_val[2 * i + 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... |