Submission #286707

#TimeUsernameProblemLanguageResultExecution timeMemory
286707OzyTowns (IOI15_towns)C++17
25 / 100
23 ms1024 KiB
#include "towns.h" #include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i = (a); i <= (b); i++) #define debug(a) cerr << #a << " = " << a << endl int largo[112]; int hubDistance(int N, int sub) { int a,b,res,c,dis,x; rep(i,0,110) largo[i] = 0; a = 0; x = 0; rep(i,1,N-1) { b = abs(getDistance(0,i)); if (b > x) { a = i; x = b; } } b = 0; x = 0; rep(i,0,N-1) { if (i != a) { largo[i] = abs(getDistance(a,i)); if (largo[i] > x) { b = i; x = largo[i]; } } } dis = largo[b]; res = 1000001; rep(i,0,N-1) { if (i != b && i != a) { c = abs(getDistance(i,b) - largo[i]); if (c < res) res = c; } } res = (dis+res)/2; cerr << res; return res; }

Compilation message (stderr)

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