제출 #1122102

#제출 시각아이디문제언어결과실행 시간메모리
1122102epicci23도시들 (IOI15_towns)C++17
0 / 100
15 ms1108 KiB
#include "bits/stdc++.h" #include "towns.h" #define all(v) v.begin() , v.end() #define sz(a) (int)a.size() using namespace std; array<int,3> solve(int ab,int ac,int bc){ int abc = (ab+ac+bc)/2; int a = abc - bc; int b = abc - ac; int c = abc - ab; return {a,b,c}; } int hubDistance(int N, int sub){ int dia1 = 0 , cur = -1; for(int i = 0; i < N ;i++){ int u = getDistance(0, i); if(u > cur){ dia1 = i; cur = u; } } int dia2 = 0; cur = -1; vector<int> uz1(N,0),uz2(N,0); for(int i = 0; i < N ; i++){ int u = getDistance(dia1, i); uz1[i] = u; if(u > cur){ dia2 = i; cur = u; } } int res = 0; for(int i = 0; i < N; i++) uz2[i] = getDistance(dia2,i); for(int i = 0; i < N; i++){ auto x = solve(cur,uz1[i],uz2[i]); res=max({res,x[0],x[1],x[2]}); } return res; }

컴파일 시 표준 에러 (stderr) 메시지

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