# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
555658 | fleimgruber | Holiday (IOI14_holiday) | C++17 | 21 ms | 5792 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.
// still only subtask 2
#include "holiday.h"
#include <bits/stdc++.h>
using namespace std;
struct SegmentTree {
int n;
struct Value {
long long sum = 0;
int size = 0;
friend Value operator+(const Value& a, const Value& b) {
return { a.sum + b.sum, a.size + b.size };
}
};
vector<Value> tree;
int round_up(int n) {
while (n & (n-1))
n++;
return n;
}
SegmentTree(int n_) : n(round_up(n_)), tree(2*n) { }
void set(int i, const Value& value) {
i += n;
tree[i] = value;
for (i /= 2; i > 0; i /= 2)
tree[i] = tree[2*i] + tree[2*i+1];
# | 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... |