# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
561739 | Jomnoi | Sprinkler (JOI22_sprinkler) | C++17 | 851 ms | 99572 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;
const int MAX_N = 2e5 + 5;
const int MAX_D = 45;
int N, L;
int H[MAX_N];
vector <int> graph[MAX_N];
int parent[MAX_N];
long long keep[MAX_N][MAX_D];
void dfs(int u, int p) {
for(auto v : graph[u]) {
if(v != p) {
parent[v] = u;
dfs(v, u);
}
}
}
void update(int u, int d, int w) {
while(u != 1 and d >= 0) {
keep[u][d] = (keep[u][d] * w) % L;
u = parent[u];
d--;
}
while(d >= 0) {
keep[1][d] = (keep[1][d] * w) % L;
# | 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... |