제출 #601529

#제출 시각아이디문제언어결과실행 시간메모리
601529jack715통행료 (IOI18_highway)C++14
5 / 100
110 ms15256 KiB
#include "highway.h" #include <bits/stdc++.h> #define ll long long #define pb push_back #define pp pop_back #define mp make_pair #define bb back #define ff first #define ss second using namespace std; vector<vector<pair<int, int> > > adj; int n, m, cost; int find(int indx, int par = -1) { for (pair<int, int> next : adj[indx]) { if (next.ff == par) continue; vector<int> q(m, 0); q[next.ss] = 1; if (ask(q) != cost) return find(next.ff, indx); } return indx; } void find_pair(int N, vector<int> U, vector<int> V, int A, int B) { n = n, m = U.size(); adj.resize(N); for (int i = 0; i < m; i++) { adj[U[i]].pb({V[i], i}); adj[V[i]].pb({U[i], i}); } vector<int> q(m, 0); cost = ask(q); answer(0, find(0)); }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...