zoukankan      html  css  js  c++  java
  • hdu

    Hard challenge

    Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
    Total Submission(s): 1083    Accepted Submission(s): 444


    Problem Description
    There are n points on the plane, and the ith points has a value vali, and its coordinate is (xi,yi). It is guaranteed that no two points have the same coordinate, and no two points makes the line which passes them also passes the origin point. For every two points, there is a segment connecting them, and the segment has a value which equals the product of the values of the two points. Now HazelFan want to draw a line throgh the origin point but not through any given points, and he define the score is the sum of the values of all segments that the line crosses. Please tell him the maximum score.
     
    Input
    The first line contains a positive integer T(1T5), denoting the number of test cases.
    For each test case:
    The first line contains a positive integer n(1n5×104).
    The next n lines, the ith line contains three integers xi,yi,vali(|xi|,|yi|109,1vali104).
     
    Output
    For each test case:
    A single line contains a nonnegative integer, denoting the answer.
     
    Sample Input
    2 2 1 1 1 1 -1 1 3 1 1 1 1 -1 10 -1 0 100
     
    Sample Output
    1 1100
     
    Source
     
    Recommend
    liuyiding   |   We have carefully selected several similar problems for you:  6132 6131 6130 6129 6128 
  • 相关阅读:
    一个简单的投票功能
    快速删除.svn文件夹
    屏蔽关键字
    批量过滤POST GET数据
    JS识别ios & 安卓
    HashMap
    GC
    类与类之间的关系
    玩转大数据之Apache Pig如何与Apache Lucene集成
    大话设计模式-简单工厂模式
  • 原文地址:https://www.cnblogs.com/stepping/p/7373896.html
Copyright © 2011-2022 走看看