# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
643498 | Vanilla | Digital Circuit (IOI22_circuit) | C++17 | 1022 ms | 20552 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>
#include "circuit.h"
typedef long long int64;
using namespace std;
const int64 mod = 1000002022;
const int maxn = 2e5 + 2;
vector <int> ad [maxn];
int64 depth[maxn];
int64 dp[4 * maxn]; // each node contributes 2^(N - depth)
int64 pref[4 * maxn];
int64 lazy[4 * maxn];
int64 pw [maxn];
int n,m;
void dfs (int x) {
for (int v: ad[x]) {
depth[v] = depth[x] + 1;
dfs(v);
}
}
int64 sum (int l, int r) {
return (pref[r] - pref[l - 1] + mod) % mod;
}
void push (int x, int l, int r) {
if (!lazy[x]) return;
int mid = (l + r) / 2;
dp[x * 2 + 1] = (sum(l, mid) - dp[x * 2 + 1] + mod) % mod;
dp[x * 2 + 2] = (sum(mid + 1, r) - dp[x * 2 + 2] + mod) % 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... |