# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
893208 | vjudge1 | Sprinkler (JOI22_sprinkler) | C++17 | 1372 ms | 117872 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 int long long
#define all(a) a.begin(), a.end()
int mod;
void prod(int &a, int b){
a = (a * b) % mod;
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n; cin >> n >> mod;
vector< vector<int> > g(n+1);
for(int i = 1;i < n; i++){
int a, b; cin >> a >> b;
g[a].push_back(b);
g[b].push_back(a);
}
vector< vector<int> > ans(n+1, vector<int>(42, 1));
vector<int> up(n+1), h(n+1);
for(int i = 1;i <= n; i++){
cin >> h[i];
}
function<void(int, int)> dfs=[&](int v, int par){
up[v] = par;
for(int to : g[v]){
if(to == par) continue;
# | 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... |