# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
29631 | osmanorhan | Dreaming (IOI13_dreaming) | C++14 | 113 ms | 15348 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 "dreaming.h"
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define umax( x, y ) x = max( x, y )
#define umin( x, y ) x = min( x, y )
using namespace std;
const int maxn = 100000;
typedef long long Lint;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
//first - where to go
//second.first - how much time to go
//second.second - length of longest path starting from this edge
vector<iii> w[maxn];
vector<int> v, ans;
bool used[maxn];
int dfs( int n, int back ) {
int ret = 0;
v.pb( n );
used[n] = 1;
for(int i=0;i<w[n].size();i++)
if( w[n][i].fi != back ) umax( ret, (w[n][i].se.se = (w[n][i].se.fi + dfs( w[n][i].fi, n ))) );
return ret;
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... |