제출 #762029

#제출 시각아이디문제언어결과실행 시간메모리
762029HamletPetrosyan철로 (IOI14_rail)C++17
30 / 100
43 ms492 KiB
#include "rail.h" using namespace std; #define ll long long ll n; ll z, h; ll d0[5005]; ll dh[5005]; void findLocation(int N, int l0, int location[], int stype[]) { n = N; z = l0; stype[0] = 1; location[0] = z; if(n == 1) return; for(int i = 1; i < n; i++){ d0[i] = getDistance(0, i); } h = 1; ll mn = d0[1]; for(int i = 2; i < n; i++){ if(mn > d0[i]){ h = i; mn = d0[i]; } } location[h] = z + mn; stype[h] = 2; dh[h] = 0; ll st = dh[0] = d0[h]; for(int i = 1; i < n; i++){ if(i == h) continue; dh[i] = getDistance(h, i); } for(int i = 1; i < n; i++){ if(i == h) continue; if(d0[i] <= dh[i]){ location[i] = z + d0[i]; stype[i] = 2; } else { location[i] = location[h] - dh[i]; stype[i] = 1; } } }

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

rail.cpp: In function 'void findLocation(int, int, int*, int*)':
rail.cpp:34:5: warning: unused variable 'st' [-Wunused-variable]
   34 |  ll st = dh[0] = d0[h];
      |     ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...