# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
629138 | kdh9949 | Digital Circuit (IOI22_circuit) | C++17 | 1304 ms | 29456 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;
using ll = long long;
const int SZ = 131072;
const ll MOD = ll(1e9) + 2022;
struct Seg {
int l[2 * SZ];
ll d[2 * SZ], w[2 * SZ];
void i(int n, vector<int> a, vector<ll> v) {
for(int i = 0; i < n; i++) w[i + SZ] = v[i];
for(int i = 0; i < n; i++) if(a[i]) d[i + SZ] = v[i];
for(int i = SZ - 1; i; i--) {
d[i] = (d[2 * i] + d[2 * i + 1]) % MOD;
w[i] = (w[2 * i] + w[2 * i + 1]) % MOD;
}
}
void flp(int x) {
d[x] = (w[x] + MOD - d[x]) % MOD;
l[x] ^= 1;
}
void u(int s, int e, int x = 1, int p = 0, int q = SZ - 1) {
if(e < p || q < s) return;
if(s <= p && q <= e) {
flp(x);
# | 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... |