제출 #125887

#제출 시각아이디문제언어결과실행 시간메모리
125887zozderRail (IOI14_rail)C++14
컴파일 에러
0 ms0 KiB
#include "rail.h"
#include <iostream>
#include <cstdlib> 

using namespace std;

int l[10000][2];//到0的路 
int mnl;

int compare(const void *x , const void *y)
{
	return ((int*)x)[1] - ((int*)y)[1];
}

int gD(int x, int y)
{
	return getDistance(x,y);
}

void findLocation(int N, int first, int location[], int stype[])
{
	location[0]=first;
	stype[0]=1;
	for(int i=1;i<N;i++)
	{
		l[i][0]=i;
		l[i][1]=gD(0,i);
	}
	qsort(l+1,N-1,sizeof(int)*2,compare);
	
	int p=1;
	mnl=l[p][0];
	p++;
	while(p<N)
	{
		int a,b,c;
		a=l[1][1];
		b=l[p][1];
		c=gD(mnl,l[p][0]);
		if(a+b=c)
		{
			location
		}
	}
	
}

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

rail.cpp: In function 'void findLocation(int, int, int*, int*)':
rail.cpp:40:10: error: lvalue required as left operand of assignment
   if(a+b=c)
          ^
rail.cpp:43:3: error: expected ';' before '}' token
   }
   ^
rail.cpp:43:3: warning: statement has no effect [-Wunused-value]