# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
102610 | popovicirobert | Race (IOI11_race) | C++14 | 753 ms | 101088 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 "race.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
typedef vector <int> VI;
typedef vector < vector <int> > VVI;
typedef vector < vector < pair <int, int> > > VVPII;
typedef vector <ll> VLL;
struct Data {
ll dst;
int lvl;
bool operator <(const Data &other) const {
if(dst == other.dst) {
return lvl < other.lvl;
}
return dst < other.dst;
}
};
void dfs(int nod, int par, VVPII &g, int &ans, vector < multiset <Data> > &mst, VLL &Dst, VI &Lvl, int k) {
for(auto it : g[nod]) {
if(it.first != par) {
Lvl[it.first] = Lvl[nod] + 1, Dst[it.first] = Dst[nod] + it.second;
dfs(it.first, nod, g, ans, mst, Dst, Lvl, k);
if(mst[nod].size() < mst[it.first].size()) {
swap(mst[nod], mst[it.first]);
}
# | 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... |