Submission #119476

#TimeUsernameProblemLanguageResultExecution timeMemory
119476sealnot123Towns (IOI15_towns)C++14
25 / 100
20 ms504 KiB
#ifdef LOCAL #include "grader.cpp" #endif #include "towns.h" #include<bits/stdc++.h> #define x first #define y second #define pb push_back #define eb emplace_back #define all(a) (a).begin(),(a).end() #define SZ(a) (int)(a).size() using namespace std; typedef long long LL; typedef pair<LL,LL> PLL; typedef pair<int,int> PII; typedef double D; typedef long double LD; const int N=115; int dist[N][N]; int hubDistance(int n, int sub) { int R = 1<<30; memset(dist, 0, sizeof dist); int a,b,c,d,e,i,j,k,l; a = 0; c = 0; for(i=1;i<n;i++){ b = getDistance(0, i); if(b > a) a = b, c = i; } a = 0; for(i=0;i<n;i++){ if(i==c) continue; dist[c][i] = getDistance(c, i); if(dist[c][i] > a) a = dist[c][i], d = i; } for(i=0;i<n;i++){ if(i==d) continue; dist[d][i] = getDistance(d, i); } for(i=0;i<n;i++){ if(i==c || i==d) continue; a = (dist[c][i] + dist[d][i] - dist[c][d])>>1; R = min(R, max(dist[c][i], dist[d][i]) - a); } return R; }

Compilation message (stderr)

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:24:14: warning: unused variable 'e' [-Wunused-variable]
  int a,b,c,d,e,i,j,k,l;
              ^
towns.cpp:24:18: warning: unused variable 'j' [-Wunused-variable]
  int a,b,c,d,e,i,j,k,l;
                  ^
towns.cpp:24:20: warning: unused variable 'k' [-Wunused-variable]
  int a,b,c,d,e,i,j,k,l;
                    ^
towns.cpp:24:22: warning: unused variable 'l' [-Wunused-variable]
  int a,b,c,d,e,i,j,k,l;
                      ^
towns.cpp:21:28: warning: unused parameter 'sub' [-Wunused-parameter]
 int hubDistance(int n, int sub) {
                            ^~~
towns.cpp:24:12: warning: 'd' may be used uninitialized in this function [-Wmaybe-uninitialized]
  int a,b,c,d,e,i,j,k,l;
            ^
#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...