답안 #3807

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
3807 2013-08-31T08:27:24 Z gs13068 Divide into triangle (kriii1_D) C++
컴파일 오류
0 ms 0 KB
#include<cstdio>

int x[900];
int y[900];
bool not[900];

int main()
{
	double t;
	int bot;
	int i,j,k,n;
	scanf("%d",&n);
	for(i=0;i<n*3;i++)scanf("%d%d",&x[i],&y[i]);
	j=0;
	for(i=1;i<n*3;i++)
	{
		if(y[i]<y[j])
			j=i;
	}
	printf("%d ",j+1);
	not[j]=true;
	bot=j;
	for(i=1;i<n*3;i++)
	{
		for(k=0;not[k];k++);
		for(j=k+1;j<n*3;j++)
		{
			if(not[j])continue;
			if(1LL*(x[j]-x[bot])*(y[k]-y[bot])<1LL*(x[k]-x[bot])*(y[j]-y[bot]))
				k=j;
		}
		printf("%d ",k+1);
		not[k]=true;
		if(i%3==2)puts("");
	}
}

Compilation message

D.cpp:5:6: error: expected unqualified-id before 'not' token
D.cpp: In lambda function:
D.cpp:21:8: error: expected '{' before '=' token
D.cpp: In function 'int main()':
D.cpp:21:8: warning: lambda expressions only available with -std=c++0x or -std=gnu++0x [enabled by default]
D.cpp:21:8: error: no match for 'operator!' in '!{j}'
D.cpp:21:8: note: candidate is:
D.cpp:21:8: note: operator!(bool) <built-in>
D.cpp:21:8: note:   no known conversion for argument 1 from 'main()::<lambda()>' to 'bool'
D.cpp: In lambda function:
D.cpp:25:17: error: expected '{' before ';' token
D.cpp: In function 'int main()':
D.cpp:25:17: warning: lambda expressions only available with -std=c++0x or -std=gnu++0x [enabled by default]
D.cpp:25:17: error: no match for 'operator!' in '!{k}'
D.cpp:25:17: note: candidate is:
D.cpp:25:17: note: operator!(bool) <built-in>
D.cpp:25:17: note:   no known conversion for argument 1 from 'main()::<lambda()>' to 'bool'
D.cpp: In lambda function:
D.cpp:28:13: error: expected '{' before ')' token
D.cpp: In function 'int main()':
D.cpp:28:13: warning: lambda expressions only available with -std=c++0x or -std=gnu++0x [enabled by default]
D.cpp:28:13: error: no match for 'operator!' in '!{j}'
D.cpp:28:13: note: candidate is:
D.cpp:28:13: note: operator!(bool) <built-in>
D.cpp:28:13: note:   no known conversion for argument 1 from 'main()::<lambda()>' to 'bool'
D.cpp: In lambda function:
D.cpp:33:9: error: expected '{' before '=' token
D.cpp: In function 'int main()':
D.cpp:33:9: warning: lambda expressions only available with -std=c++0x or -std=gnu++0x [enabled by default]
D.cpp:33:9: error: no match for 'operator!' in '!{k}'
D.cpp:33:9: note: candidate is:
D.cpp:33:9: note: operator!(bool) <built-in>
D.cpp:33:9: note:   no known conversion for argument 1 from 'main()::<lambda()>' to 'bool'
D.cpp:9:9: warning: unused variable 't' [-Wunused-variable]
D.cpp:12:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
D.cpp:13:45: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]