zoukankan      html  css  js  c++  java
  • 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


    Problem Description
    As this term is going to end, DRD needs to start his graphical homework.

    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. 

     
    Input
    First line: a positive integer T10 indicating the number of test cases.
    There are T cases following. In each case, the first line contains an positive integer n1000, 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. 
     
    Output
    For each test case: output ''Case #x: ans'' (without quotes), where x is the number of the cases, and ans is the area these points form.
    Your answer is considered correct if and only if the absolute error or the relative error is smaller than 106

     
    Sample Input
    2 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
     
    Sample Output
    Case #1: 4.000000 Case #2: 5.333333
     
    Source
     
     
     
     
  • 相关阅读:
    P2617 Dynamic Rankings 动态主席树
    P4338 [ZJOI2018]历史 LCT+树形DP
    P3348 [ZJOI2016]大森林
    P3613 睡觉困难综合征 LCT+贪心+位运算
    SP16549 QTREE6
    P3703 [SDOI2017]树点涂色 LCT维护颜色+线段树维护dfs序+倍增LCA
    U19464 山村游历(Wander) LCT维护子树大小
    P4219 [BJOI2014]大融合 LCT维护子树大小
    P2542 [AHOI2005]航线规划 LCT维护双连通分量
    P3950 部落冲突
  • 原文地址:https://www.cnblogs.com/gongpixin/p/6786300.html
Copyright © 2011-2022 走看看