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 ...
随机推荐
- SpringMVC 的重定向时,参数非法问题
在重定向时,携带的参数出现非法 /shopping/editShippingAddressCart?cs=0eaa49d6-9c6e-4d02-85d0-40c3c7939207|ef9d80b1-7 ...
- JS全选
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"% ...
- Shell grep 和正则
在grep中正则有三种模式, 分别是基础(-G), 扩展(-E)和Perl(-P)模式 basic 模式 不支持\d, 支持\w \s \b. ?, +, {, |, (, and ) 在basic ...
- mac中Eclipse的快捷键
查看某个类:command + shift +T 快速查看源代码中方法: command + o 选中某个类,command + t:查看此类的父类和子类 如果要导入一个类所在的包名,可以选中这个类, ...
- 十、oracle 常用函数
一.字符函数字符函数是oracle中最常用的函数,我们来看看有哪些字符函数:lower(char):将字符串转化为小写的格式.upper(char):将字符串转化为大写的格式.length(char) ...
- forEach用法介绍
array.forEach(callback[, thisArg]) forEach() 方法让数组的每一项都执行一次给定的函数. callback在数组每一项上执行的函数,接收三个参数: curre ...
- Ubuntu+Django+mod_wsgi+Apache配置过程
Ubuntu15.10 Apache2.4( sudo apt-get install apache2 ) Python3.4( sudo apt-get install apache2 ), [系 ...
- WHM API 1 - createacct
WHM API 1 - createacct Skip to end of metadata Created by Sync User, last modified on Sep 29, ...
- http?https?相对协议?
1 1 1 将CDN 上所有链接的协议默认设置为“相对协议”,也就是链接以 // 开头,前面去掉了 http: 或 https: 字样, 这样做的好处是浏览器能够根据你的网站所采用的协议来自动加载 C ...
- 避免IE执行AJAX时,返回JSON出现下载文件
<bean id="mappingJacksonHttpMessageConverter" class="org.springframework.http.conv ...