Submission #15986

#TimeUsernameProblemLanguageResultExecution timeMemory
15986myungwooComputer Network (BOI14_network)C++14
0 / 100
93 ms5716 KiB
#include "network.h" #include <bits/stdc++.h> using namespace std; #define MAXN 1003 int N, A, B; int D[MAXN], E[MAXN]; void findRoute (int n, int a, int b) { N = n, A = a, B = b; for (int i=1;i<=N;i++){ D[i] = (A == i ? 0 : ping(A, i) + 1); E[i] = (B == i ? 0 : ping(B, i) + 1); } vector <int> arr; for (int i=1;i<=N;i++) if (D[i]+E[i] == D[B]) arr.push_back(i); sort(arr.begin(), arr.end(), [](const int &a, const int &b){ return D[a] < D[b]; }); for (int i=1;i<arr.size();i++) printf("%d\n", arr[i]); for (int i=1;i<arr.size();i++) travelTo(arr[i]); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...