地址:http://acm.split.hdu.edu.cn/showproblem.php?pid=6206

题目:

Apple

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 530    Accepted Submission(s): 172

Problem Description
Apple is Taotao's favourite fruit. In his backyard, there are three apple trees with coordinates (x1,y1), (x2,y2), and (x3,y3). Now Taotao is planning to plant a new one, but he is not willing to take these trees too close. He believes that the new apple tree should be outside the circle which the three apple trees that already exist is on. Taotao picked a potential position (x,y) of the new tree. Could you tell him if it is outside the circle or not?
 
Input
The first line contains an integer T, indicating that there are T(T≤30) cases.
In the first line of each case, there are eight integers x1,y1,x2,y2,x3,y3,x,y, as described above.
The absolute values of integers in input are less than or equal to 1,000,000,000,000.
It is guaranteed that, any three of the four positions do not lie on a straight line.
 
Output
For each case, output "Accepted" if the position is outside the circle, or "Rejected" if the position is on or inside the circle.
 
Sample Input
3
-2 0 0 -2 2 0 2 -2
-2 0 0 -2 2 0 0 2
-2 0 0 -2 2 0 1 1
 
Sample Output
Accepted
Rejected
Rejected
 
Source
 
思路:
  这题关键是找圆心,如果圆心知道了,后面的都好做了。
  圆心坐标公式,来自维基:
  

  这题精度要求高,直接用double or long double都会挂。

  做法有俩个:

  1.保留除法运算,那就只能用java的BigDecimal(好像叫这个)

  2.进行公式化简:

  

  所以这时只需要比较分子就好了,只需要大数模板。

  然而我知道怎么做还是wa一下午,依旧没过,不会java,用c++的大数模板写又写挂了。。。gg,心痛。

  这题还可以圆的反演做。

  没有代码贴了。

  

hdu6206 Apple的更多相关文章

  1. iOS: 在iPhone和Apple Watch之间共享数据: App Groups

    我们可以在iPhone和Apple Watch间通过app groups来共享数据.方法如下: 首先要在dev center添加一个新的 app group: 接下来创建一个新的single view ...

  2. 一道Apple公司(中国)的面试题目

    Apple在中国(上海)有公司业务,但是感觉主要是做测试工作的部门,主要是保障Apple的产品质量QE.面试的时候,面试官出了一道题目,我貌似曾今开过类似的题目,但是由于当场发挥不佳没有答出来.题目大 ...

  3. apple常用网址

    https://developer.apple.com/ https://itunesconnect.apple.com/ iTunes Connect Developer Guide https:/ ...

  4. Apple Pay 初探

    Apple Pay 一.概述 1.支付方式:Touch ID/ Passcode 2.设备要求:iPhone6以上(iphone:线上/线下 ipad:线上 watch:线下) 3.系统要求:iOS8 ...

  5. Apple、Google、Microsoft的用户体验设计原则

    轻巧的Apple 注重设计过程: 在设计过程中引入用户交互的5个目标: 了解您的目标客户 分析用户的工作流 构造原型系统 观察用户测试 制定观察用户准则 做出设计决定 避免功能泛滥 80% 方案 优秀 ...

  6. 【转】iOS开发 -- Apple Pay

    技术博客原地址:http://www.cnblogs.com/dashunzi/p/ApplePay.html#top 原技术博客中有源码和视频,有感兴趣的朋友可以研究一下! 一.什么是Apple P ...

  7. Apple的LZF算法解析

    有关LZF算法的相关解析文档比较少,但是Apple对LZF的开源,可以让我们对该算法进行一个简单的解析.LZFSE 基于 Lempel-Ziv ,并使用了有限状态熵编码.LZF采用类似lz77和lzs ...

  8. [css]我要用css画幅画(九) - Apple Logo

    接着之前的[css]我要用css画幅画(八) - Hello Kitty,这次画的是苹果公司的logo 这次打算将分析和实现步骤尽量详细的说一说. 其实之前的也打算详细讲分析和设计过程,不过之前的图比 ...

  9. [Erlang 0106] Erlang实现Apple Push Notifications消息推送

        我们的IOS移动应用要实现消息推送,告诉用户有多少条消息未读,类似下图的效果(笑果),特把APNS和Erlang相关解决方案笔记于此备忘.          上面图片中是Apple Notif ...

随机推荐

  1. SQL的学习

    1. 判断表达式的值是否为空在表达式后面接 IS NULL 或 IS NOT NULL 可以判断表达式是否为空或不为空 2. 把数据库中的数据导出成可执行的SQL语句对数据库点击右键一次选择 任务-- ...

  2. php求数学对数

    php的对数函数并不是很强大 有自然对数 有10的对数的函数,不过没有自定义底的对数函数,所以自己写了一个 <?php function xsqrt($x, $value) { $count = ...

  3. android签名,制作key

    签名具体步骤: Apk签名首先要有一个keystore的签名用的文件. keystore是由jdk自带的工具keytool生成的.具体生成方式参考一下: 开始->运行->cmd->c ...

  4. JDK的图文安装教程

    JDK的安装 什么是JDK? JDK就是Java开发工具包,即Java Development Kit.就是做Java开发所需要的最基本的工具.包括Java编译器(把人使用的Java语言变成JVM能运 ...

  5. (转)Java DecimalFormat 用法(数字格式化)

    我们经常要将数字进行格式化,比如取2位小数,这是最常见的.Java 提供 DecimalFormat 类,帮你用最快的速度将数字格式化为你需要的样子.下面是常用的例子: import java.tex ...

  6. 查看嵌入式设备的CPU频率

    对于有多个核心的CPU,查看CPU 频率的方法是: cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq 上面的这个是查看核心0的cpu的 ...

  7. GROUP_CONCAT 拼接顺序

    用 group_concat 拼接后的顺序 group_concat(id order by id) 里面id更新需要更换

  8. Jenkins 持续集成配置

    Jenkins搭建.NET自动编译测试与发布环境 Jenkins之Deploy部署(包括站点和类库项目) * 续篇--TFS+MSbuild+jenkins 实现 持续集成+自动部署到WEB网站 Je ...

  9. netty4.x 实现接收http请求及响应

    参考 netty4.x 实现接收http请求及响应 - En taro tassadar - CSDN博客 https://blog.csdn.net/sinat_39783636/article/d ...

  10. wiki配置文件

    jira数据库配置文件(链接:https://blog.csdn.net/jiangguilong2000/article/details/39718407) /var/atlassian/appli ...