hdu 5243 Homework
Homework
Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 413 Accepted Submission(s): 48
In his homework, DRD needs to partition a point set S into two part. You can see that if one part has 100 points and the other has only 1 point, then this partition cannot be beautiful since it's too imbalanced. DRD wants to find a line to separate S, so that no points lie in the line and there are at least ⌊|S|3⌋ points in each side of the line. DRD finds it amazing that there may exist some points (no need to be in S) that if a line l passes it and does not pass any points in S, then l can be a separating line. Now, he wonders the area these points form.
There are T cases following. In each case, the first line contains an positive integer n≤1000, and n lines follow. In each of these lines, there are 2 integers xi,yiindicating a point (xi,yi) in the plane. Note that |xi|,|yi|≤104
You can assume that no three points in S lies in the same line.
Your answer is considered correct if and only if the absolute error or the relative error is smaller than 10−6.
4
1 1
1 -1
-1 -1
-1 1
8
-1 -1
-1 1
1 -1
1 1
-2 -2
-2 2
2 -2
2 2
Case #2: 5.333333
hdu 5243 Homework的更多相关文章
- HDU——1789Doing Homework again(贪心)
Doing Homework again Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Oth ...
- 动态规划: HDU 1789Doing Homework again
Problem Description Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of h ...
- HDU 1789 Doing Homework again (贪心)
Doing Homework again http://acm.hdu.edu.cn/showproblem.php?pid=1789 Problem Description Ignatius has ...
- HDU 1074 Doing Homework (dp+状态压缩)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1074 题目大意:学生要完成各科作业, 给出各科老师给出交作业的期限和学生完成该科所需时间, 如果逾期一 ...
- 【状态DP】 HDU 1074 Doing Homework
原题直通车:HDU 1074 Doing Homework 题意:有n门功课需要完成,每一门功课都有时间期限t.完成需要的时间d,如果完成的时间走出时间限制,就会被减 (d-t)个学分.问:按怎样 ...
- HDU 1074 Doing Homework (动态规划,位运算)
HDU 1074 Doing Homework (动态规划,位运算) Description Ignatius has just come back school from the 30th ACM/ ...
- hdu 1789 Doing HomeWork Again (贪心算法)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1789 /*Doing Homework again Time Limit: 1000/1000 MS ...
- HDU 1789 - Doing Homework again - [贪心+优先队列]
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1789 Time Limit: 1000/1000 MS (Java/Others) Memory Li ...
- HDU 5298 Solid Geometry Homework 暴力
Solid Geometry Homework 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5298 Description Yellowstar ...
随机推荐
- ThinkPHP在入口文件中判断是手机还是PC端访问网站
<?php// +----------------------------------------------------------------------// | ThinkPHP [ WE ...
- Python3.6全栈开发实例[010]
10.有字符串 "k:1|k1:2|k2:3|k3:4" 处理成字典 {'k':1,'k1':2....} s = "k:1|k1:2|k2:3|k3:4" d ...
- centos7 Mysql5.6 升级Mysql5.7
1 2. 卸载Mysql5.6 ,一共有三个包 要卸载: (1)先卸载mysql-server包 : 执行命令 yum remove mysql mysql-server (2)再卸载mysql-c ...
- spring中配置缓存—ehcache
常用的缓存工具有ehcache.memcache和redis,这里介绍spring中ehcache的配置. 1.在pom添加依赖: <!-- ehcache 相关依赖 --> <de ...
- Python之简单函数练习(Day30)
1.写函数,,用户传入修改的文件名,与要修改的内容,执行函数,完成批了修改操作 def modify_file(filename,old,new): import os with open(filen ...
- 2015.7.14(大盘结束红色,中色连坐4T)
中色今天的盘面相当有意思,现场直播庄家和散户斗法我估计中色要拉涨停了,不过你别跟,现在很危险了——就算是涨停,明天一个低开就把你给绕进去了 1.今天开市9:42发现中色的地位买入点良机16.13,此时 ...
- 浅谈HTTPS协议
前言 理解协议是做接口测试的前提.本文主要向大家展示博主对HTTPS协议的理解,网上有诸多资料,有些写得过于晦涩难懂,尤其是需要密码学的一些知识.我做了一下简单的整理,刨除复杂的底层实现,单从理解SS ...
- iOS UIScrollView 滚动到当前展示的视图居中展示
需求展示: 测试效果1 first uiscrollView 宽度 为屏幕宽度 滚动步长 为 scroll 宽度的1/3 分析: 这个是最普通版 无法使每一次滚动的结果子视图居中展示, WA ...
- Linux Shell基础 Shell的输入重定向和输出重定向
概述 在 Linux 中输入设备指的是键盘,输出设备指的是显示器.在 Linux 中,所有的内容都是文件,计算机硬件也是文件,标准输入设备(键盘)和标准输出设备(显示器)也是文件.这些设备的设备文件名 ...
- NoSQL数据库memcache和redis区别
在web后台发开面试中,经常会被问道memcache和redis的区别和使用情况. 其中memcache和redis都是基于内存存储的缓存系统,存储形式key--value键值对的形式. 区别: 1. ...