# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
97524 | Alexa2001 | Ideal city (IOI12_city) | C++17 | 277 ms | 22548 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 Mod = 1e9, Nmax = 1e5 + 5;
typedef long long ll;
int n, x[Nmax], y[Nmax], w[Nmax];
vector<int> edge[Nmax], v[Nmax];
void dfs(int node, int dad = 0)
{
for(auto it : edge[node])
if(it != dad)
{
dfs(it, node);
w[node] += w[it];
w[node] %= Mod;
}
}
void add_edge(set< pair<int,int> > &Edges, int x, int y)
{
if(Edges.find({x, y}) != Edges.end()) return;
edge[x].push_back(y); edge[y].push_back(x);
Edges.insert({x, y});
}
int calc_dist() /// vertical
{
Compilation message (stderr)
# | 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... |