# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1087197 | guagua0407 | Towns (IOI15_towns) | C++17 | 12 ms | 1112 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;
#define ll long long
#define pii pair<int,int>
#define f first
#define s second
#define all(x) x.begin(),x.end()
#define _ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int hubDistance(int N, int sub) {
map<pair<int,int>,int> mpp;
function<int(int,int)> get=[&](int a,int b){
if(a>b) swap(a,b);
if(mpp.find({a,b})!=mpp.end()) return mpp[{a,b}];
else{
mpp[{a,b}]=getDistance(a,b);
return mpp[{a,b}];
}
};
int n=N;
vector<int> dis(n);
for(int i=0;i<n;i++){
dis[i]=get(0,i);
}
int x=max_element(all(dis))-dis.begin();
for(int i=0;i<n;i++){
dis[i]=get(x,i);
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... |