Submission #494645

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4946452021-12-16 00:48:22thecodingwizardTowns (IOI15_towns)C++11
13 / 100
199 ms632 KiB
#include <bits/stdc++.h>
#include "towns.h"
using namespace std;
#define ii pair<int, int>
#define mp make_pair
int A, B;
int dA, dB;
map<ii, int> cached;
int getD(int a, int b) {
if (a == b) return 0;
if (a > b) swap(a, b);
if (cached.count(mp(a, b))) return cached[mp(a, b)];
return cached[mp(a, b)] = getDistance(a, b);
}
int getR(int x) {
if (x == A) return dA;
if (x == B) return dB;
return (getD(A, x) + getD(B, x) - getD(A, B)) / 2;
}
int isInA(int x) {
return (getD(x, A) + getD(A, B) - getD(B, x)) / 2 != dA;
}
int isInB(int x) {
return (getD(x, B) + getD(A, B) - getD(A, x)) / 2 != dB;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:32:28: warning: unused parameter 'sub' [-Wunused-parameter]
   32 | int hubDistance(int N, int sub) {
      |                        ~~~~^~~
#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...