제출 #705290

#제출 시각아이디문제언어결과실행 시간메모리
705290Hacv16철로 (IOI14_rail)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "rail.h"

const int MAX = 2e6 + 15;
const int INF = 0x3f3f3f3f;

int dist[MAX][2];

void findLocation(int n, int first, int location[], int stype[]){
	int mn = INF, mnId = 0;

	for(int i = 1; i < n; i++){
		int curDist = getDistance(0, i);
		dist[i][0] = curDist;

		if(dist[i][0] < mn)
			mn = dist[i][0], mnId = i;
	}

	for(int i = 1; i < n; i++){
		int curDist = getDistance(mnId, i);	
		dist[i][1] = curDist;
	}

	location[0] = first;
	stype[0] = 1;

	location[mnId] = first + dist[mnId][0];
	stype[mnId] = 2;

	for(int i = 1; i < n; i++){
		if(i == mnId) continue;

		if(dist[i][1] < dist[i][0]){
			stype[i] = 1;
			location[i] = location[mnId] - dist[i][1];
		}else{
			stype[i] = 2;
			location[i] = location[0] + dkst[i][0];
		}
 	}
}	

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

rail.cpp: In function 'void findLocation(int, int, int*, int*)':
rail.cpp:39:32: error: 'dkst' was not declared in this scope; did you mean 'dist'?
   39 |    location[i] = location[0] + dkst[i][0];
      |                                ^~~~
      |                                dist