# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
133187 | muradeyn | Valley (BOI19_valley) | C++14 | 571 ms | 47384 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.
/* Murad Eynizade */
#include <bits/stdc++.h>
#define intt long long
#define fyck ios_base::sync_with_stdio(0);cin.tie(0);
#define F first
#define S second
//#define endl '\n'
using namespace std;
const int maxx = 100001 , lg = 17;
int n , m , q , ex , nxt;
int lvl[maxx] , in[maxx] , dp[maxx] , shop[maxx] , cnt[maxx];
intt dist[maxx] , table[maxx][lg] , close[maxx] , par[maxx][lg];
vector< pair<int,intt> >v[maxx] , arr;
void dfs(int s,int p) {
dp[s] = 1;
cnt[s] = shop[s];
par[s][0] = p;
in[s] = ++nxt;
lvl[s] = lvl[p] + 1;
for (auto to : v[s])
if (to.F != p) dist[to.F] = dist[s] + to.S , dfs(to.F , s) , dp[s] += dp[to.F] , cnt[s] += cnt[to.F];
}
# | 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... |