# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
807700 | dong_liu | Cake 3 (JOI19_cake3) | C++17 | 700 ms | 9536 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;
#define N 200000
namespace kactl {
typedef long long ll;
#define sz(x) int(x.size())
/**
* Author: Lukas Polacek
* Date: 2009-10-30
* License: CC0
* Source: folklore/TopCoder
* Description: Computes partial sums a[0] + a[1] + ... + a[pos - 1], and
* updates single elements a[i], taking the difference between the old and new
* value. Time: Both operations are $O(\log N)$. Status: Stress-tested
*/
struct FT {
vector<ll> s;
vector<int> k;
void init(int n) {
s.assign(n, 0);
k.assign(n, 0);
}
void update(int pos, ll dif, int c) { // a[pos] += dif
for (; pos < sz(s); pos |= pos + 1) {
s[pos] += dif;
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... |