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

我官方数据都过了,但交上去就是WA,莫非数据加强了?哪位路过的大虾帮忙看一下……

Posted by 695375900 at 2009-08-14 10:49:48 on Problem 1673
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
    freopen("1.txt","w",stdout);
    int t;
    scanf("%d",&t);
    while(t--)
    {
        double ax,ay,bx,by,cx,cy;
        scanf("%lf%lf%lf%lf%lf%lf",&ax,&ay,&bx,&by,&cx,&cy);
        double hy=(((cx-ax)*(ax-bx)+(ay-by)*cy)*(cx-bx)+(by-cy)*(ax-bx)*ay)/((by-cy)*(ax-bx)+(cx-bx)*(ay-by));
        double hx;
        if(abs(ax-bx)>1e-8)hx=cx-(hy-cy)*(ay-by)/(ax-bx);
        else hx=ax-(ay-hy)*(by-cy)/(cx-bx);
        printf("%.4lf %.4lf\n",hx,hy);
    }
    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