# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
628559 | 600Mihnea | Digital Circuit (IOI22_circuit) | C++17 | 1299 ms | 33176 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 "circuit.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1000002022;
struct Vertex {
int s0, s1;
};
vector<int> c, now;
int dim, subtract;
vector<Vertex> tree;
vector<int> lazy;
void build(int v, int tl, int tr) {
lazy[v] = 0;
if (tl == tr) {
tree[v].s0 = now[tl] * c[tl];
tree[v].s1 = (1 - now[tl]) * c[tl];
} else {
int tm = (tl + tr) / 2;
build(2 * v, tl, tm);
build(2 * v + 1, tm + 1, tr);
tree[v].s0 = tree[2 * v].s0 + tree[2 * v + 1].s0;
tree[v].s1 = tree[2 * v].s1 + tree[2 * v + 1].s1;
if (tree[v].s0 >= MOD) tree[v].s0 -= MOD;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |