Submission #306062

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3060622020-09-24 12:18:33eriksuenderhaufStations (IOI20_stations)C++17
0 / 100
918 ms768 KiB
#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
vector<int> deg(n);
vector<vector<int>> adj(n);
for (int i = 0; i < n - 1; i++)
deg[u[i]]++, deg[v[i]]++, adj[u[i]].push_back(v[i]), adj[v[i]].push_back(u[i]);;
vector<int> labels(n);
// if (*max_element(deg.begin(), deg.end()) <= 2) {
// int r = min_element(deg.begin(), deg.end()) - deg.begin(), p = -1;
// labels[r] = 0;
// for (int i = 1; i < n; i++) {
// if (~p) adj[r].erase(find(adj[r].begin(), adj[r].end(), p));
// tie(r, p) = make_pair(adj[r][0], r);
// labels[r] = i;
// }
// iota(labels.begin(), labels.end(), 0);
// function<void(int,int,int)> dfs = [&](int u, int p, int l) {
// labels[u] = l;
// adj[u].erase(find(adj[u].begin(), adj[u].end(), p));
// if (!adj[u].empty())
// dfs(adj[u][0], u, l+1);
// };
// int r = max_element(deg.begin(), deg.end()) - deg.begin();
// int lo = 1; labels[r] = 0;
// for (int v: adj[r]) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...