제출 #1291176

#제출 시각아이디문제언어결과실행 시간메모리
1291176kustov_vadim_533도시들 (IOI15_towns)C++20
0 / 100
9 ms1856 KiB
#include <iostream> #include <algorithm> #include <math.h> #include <vector> #include <set> #include <queue> #include <array> #include <map> #include <random> #include <bitset> #include <stack> #include <deque> #include <random> #include <unordered_set> #include <unordered_map> #include <string> #include <chrono> #include "towns.h" using namespace std; typedef long long ll; typedef long double ld; mt19937 gen(chrono::steady_clock::now().time_since_epoch().count()); int hubDistance(int N, int sub) { int v = 0; int ds = 0, s = 0; for (int u = 0; u < N; ++u) { int du = getDistance(v, u); if (du > ds) { ds = du; s = u; } } vector<int> d; for (int u = 0; u < N; ++u) { d.push_back(getDistance(s, u)); } sort(d.begin(), d.end()); int mx = 0; for (int x : d) { if (x * 2 < d.back()) { mx = max(mx, x); } } return mx; }
#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...