# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
972431 | Nika533 | Dreaming (IOI13_dreaming) | C++14 | 48 ms | 16432 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.
#pragma GCC diagnostic warning "-std=c++11"
#include <bits/stdc++.h>
#include "dreaming.h"
#define pb push_back
#define f first
#define s second
#define MOD 1000000007
#define flush fflush(stdout)
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(), (x).rend()
#define pii pair<int,int>
using namespace std;
const int NMAX=1e5+5;
int n,m,fix[NMAX],mx[NMAX],NEXT[NMAX];
vector<pii> g[NMAX];
void dfs(int x, int p) {
mx[x]=0; NEXT[x]=-1; fix[x]=1;
if (x!=p && g[x].size()==1) return;
for (auto A:g[x]) {
int y=A.f,w=A.s;
if (y==p) continue;
dfs(y,x);
if (mx[x]<w+mx[y]) {
mx[x]=w+mx[y];
NEXT[x]=y;
}
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |