HDU 2671 Can't be easier
简单的几何题目
点(a,b)关于直线Ax+By+C=1对称点的公式

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std; double k;
double X1,Y1,X2,Y2,X3,Y3,X4,Y4;
int T;
double a,b,c; int main()
{
scanf("%d",&T);
while(T--)
{
scanf("%lf",&k);
scanf("%lf%lf%lf%lf%lf%lf",&X1,&Y1,&X2,&Y2,&X3,&Y3);
a=k,b=-,c=Y3-k*X3;
X4=X1-*a*(a*X1+b*Y1+c)/(a*a+b*b);
Y4=Y1-*b*(a*X1+b*Y1+c)/(a*a+b*b);
printf("%.2lf\n",max(sqrt((X2-X1)*(X2-X1)+(Y2-Y1)*(Y2-Y1)), sqrt((X2-X4)*(X2-X4)+(Y2-Y4)*(Y2-Y4))));
}
return ;
}
HDU 2671 Can't be easier的更多相关文章
- HDU 2671 Can't be easier(数学题,点关于直线对称)
题目 //数学题//直线 y = k * x + b//直线 ax+by+c=0; 点 (x0,y0); 点到直线距离 d = (ax0+by0+c)/sqrt(a^2+b^2) /********* ...
- hdu 2671 shǎ崽 OrOrOrOrz(排序)
题意:排序后按题目要求输出 思路:排序 #include<iostream> #include<stdio.h> #include<algorithm> using ...
- HBase官方文档
HBase官方文档 目录 序 1. 入门 1.1. 介绍 1.2. 快速开始 2. Apache HBase (TM)配置 2.1. 基础条件 2.2. HBase 运行模式: 独立和分布式 2.3. ...
- hdu 1039 Easier Done Than Said? 字符串
Easier Done Than Said? Time Limi ...
- HDU 1039.Easier Done Than Said?-条件判断字符串
Easier Done Than Said? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/O ...
- 题解报告:hdu 1039 Easier Done Than Said?
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1039 Problem Description Password security is a trick ...
- HDU 1039.Easier Done Than Said?【字符串处理】【8月24】
Easier Done Than Said? Problem Description Password security is a tricky thing. Users prefer simple ...
- HDOJ/HDU 1039 Easier Done Than Said?(字符串处理~)
Problem Description Password security is a tricky thing. Users prefer simple passwords that are easy ...
- HDU 1039 -Easier Done Than Said?
水水的 #include <iostream> #include <cstring> using namespace std; ]; bool flag; int vol,v2 ...
随机推荐
- 解决 .NET Core 中 GetHostAddressesAsync 引起的 EnyimMemcached 死锁问题
在我们将站点从 ASP.NET + Windows 迁移至 ASP.NET Core + Linux 的过程中,目前遇到的最大障碍就是 —— 没有可用的支持 .NET Core 的 memcached ...
- 从0开始学习blockchain
http://www.8btc.com/build-your-own-blockchain
- cookie和session的区别(搜狐笔试考到的一个题目)
一.cookie机制和session机制的区别***************************************************************************** ...
- HTML+CSS Day10实例
1.家居大视野 效果图: 代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "h ...
- 封装一个Ajax工具函数
/*封装一个ajax工具函数*/ window.$ = {}; /*通过$定义一个ajax函数*/ /* * 1. type string 请求的方式 默认是get * 2. url ...
- HDU 2722 Here We Go(relians) Again (spfa)
Here We Go(relians) Again Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/ ...
- 字符串匹配算法之KMP
字符串匹配是计算机的基本任务之一. 举例来说,有一个字符串"BBC ABCDAB ABCDABCDABDE",我想知道,里面是否包含另一个字符串"ABCDABD" ...
- SMO 的环境
Microsoft SQL Server System CLR Types - http://go.microsoft.com/fwlink/?LinkId=123721&clcid=0x40 ...
- Linux系统手动安装rpm包依赖关系分析(以Kernel升级为例)
有在Linux系统中安装软件的经历的人都知道,在Linux系统中手动安装软件不想在Windows下安装软件那么方便,直接双击,然后下一步下一步就可以把软件成功的装入到系统中,而在Linux系统中,安装 ...
- hdu_3966_Aragorn's Story(树链剖分裸题)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=3966 题意:给你一棵树,然后给定点之间的路径权值修改,最后单点查询 题解:树链剖分裸题,这里我用树状数 ...