# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
135679 | E869120 | Cake 3 (JOI19_cake3) | C++14 | 3480 ms | 35380 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 <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#pragma warning (disable: 4996)
class SegmentTree {
public:
vector<long long> dat1, dat2; int size_ = 1;
void init(int sz) {
while (size_ <= sz) size_ *= 2;
dat1.resize(size_ * 2, 0);
dat2.resize(size_ * 2, 0);
}
void add(int pos,long long x) {
pos += size_;
while (pos >= 1) {
dat1[pos]++; dat2[pos] += x;
pos >>= 1;
}
}
void lose(int pos, long long x) {
pos += size_;
while (pos >= 1) {
dat1[pos]--; dat2[pos] -= x;
pos >>= 1;
}
}
long long getmax(long long M) {
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... |