Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

请管理员检查下数据,确实有三点共线的数据。

Posted by flyingfish at 2006-08-29 12:07:36 on Problem 2986
In Reply To:Re:We guarantee the triangle and the circle are not degenerate. Posted by:wolfshow at 2006-08-29 11:16:00
> 我也是本着这句话做的,但事实似乎证明的确有几乎共线的数据。
> #include<stdio.h>
> #include<math.h>
> double det(double a,double b,double c,double d)
> {
> 	return a*d-b*c;
> }
> #define eps 1e-8
> int main()
> {
> 	int cc;
> 	double x[5],y[5],r;
> 	while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf%lf",
> 		&x[1],&y[1],&x[2],&y[2],&x[3],&y[3],&x[4],&y[4],&r)==9)
> 	{
> 		if(fabs(det(x[2]-x[1],y[2]-y[1],x[3]-x[1],y[3]-y[1]))<eps)
> 		while(1)
> 		{
> 			;
> 		}
> 	}
> 	return 0;
> }

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator