# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1122929 | gustavo_d | Towns (IOI15_towns) | C++17 | 254 ms | 512 KiB |
#include "towns.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
int cnt;
int cache[MAXN][MAXN];
int dist(int a, int b) {
if (a > b) swap(a, b);
if (a == b) return 0;
if (cache[a][b] != -1) return cache[a][b];
cnt--;
assert(cnt >= 0);
// cerr << "get "<< a << ' ' << b << endl;
return cache[a][b] = getDistance(a, b);
}
int hubDistance(int n, int sub) {
for (int i=0; i<n; i++) {
for (int j=0; j<n; j++) {
cache[i][j] = -1;
}
}
cnt = n*(n-1)/2;
int r = 1e9;
if (sub == 1 or true) {
for (int i=0; i<n; i++) {
for (int j=i+1; j<n; j++) {
// cerr << endl << endl;
// cerr << "Olhando: " << i << ' ' << j << endl;
# | 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... |