# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
798410 | HunterXD | Roadside Advertisements (NOI17_roadsideadverts) | C++17 | 1072 ms | 6140 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;
typedef int ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define all(x) x.begin(), x.end()
#define pb push_back
const char nd = '\n';
struct edge {
ll v, w;
};
vector<vector<edge>> graph;
bitset<50001> visto;
ll res = 0;
ll dfs(ll u, ll p, ll cup) {
ll cdown = 0, temp;
if (visto[u]) cup++, cdown++;
for (auto v : graph[u]) {
if (v.v == p) continue;
temp = dfs(v.v, u, cup);
if (cup && temp) res += v.w;
cdown += temp;
}
return cdown;
# | 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... |