| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 785481 | NothingXD | Towns (IOI15_towns) | C++17 | 14 ms | 348 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 "towns.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef complex<ld> point;
void debug_out(){cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T){
cerr << H << " ";
debug_out(T...);
}
#define debug(...) cerr << "(" << #__VA_ARGS__ << "): ", debug_out(__VA_ARGS__)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define MP(x, y) make_pair(x, y)
const int maxn = 200 + 10;
int n, dis[2][maxn];
int hubDistance(int N, int sub) {
n = N;
for (int i = 0; i < n; i++){
dis[0][i] = getDistance(0, i);
//debug(i, dis[0][i]);
}
int r1 = max_element(dis[0], dis[0] + n) - dis[0];
//debug(r1);
for (int i = 0; i < n; i++){
dis[0][i] = getDistance(r1, i);
//debug(i, dis[0][i]);
}
int r2 = max_element(dis[0], dis[0] + n) - dis[0];
//debug(r2);
for (int i = 0; i < n; i++){
dis[1][i] = getDistance(r2, i);
//debug(i, dis[1][i]);
}
int ans = dis[0][r2];
for (int i = 0; i < n; i++){
int tmp = (dis[0][i] + dis[0][r2] - dis[1][i]) / 2;
ans = min(ans, max(tmp, dis[0][r2] - tmp));
}
return ans;
}
Compilation message (stderr)
| # | 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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
