zoukankan      html  css  js  c++  java
  • uva 6757 Cup of Cowards(中途相遇法,貌似)

    uva 6757 Cup of Cowards
    Cup of Cowards (CoC) is a role playing game that has 5 different characters (Mage, Tank, Fighter,
    Assassin and Marksman). A team consists of 5 players (one from each kind) and the goal is to kill a
    monster with L life points. The monster dies if the total damage it gets is at least L. Each character
    has a certain number of allowed hits, each hit has a certain damage and a certain cost (the cost and
    damage might be different for each character). The team wants to kill the monster using the minimum
    cost so they can perform better in later missions. They want your help to find the minimum cost they
    will pay to kill the monster and the damage they should incur on it.
    Input
    Your program will be tested on one or more test cases. The first line of the input will be a single
    integer T, the number of test cases (1 ≤ T ≤ 100). Followed by the test cases, the first line of each
    test case contains 1 integer L (0 ≤ L ≤ 1012) representing the life points of the monster. Followed by
    5 lines, each one contains 3 integers separated by a single space H D C representing the maximum
    number of hits, the damage by each hit and the cost of each hit by one of the characters, respectively
    (0 ≤ H ≤ 1, 000), (0 ≤ D, C ≤ 109
    ) and the sum of the maximum number of hits for all characters will
    not be more than 1,000.
    Output
    For each test case, print a single line which contains 2 space separated integers, the first is the minimum
    cost for the hits used to kill the monster and the second is the damage incurred upon the monster. If
    there is more than one way to kill the monster using the same minimum cost, select the one with the
    least damage and if there is no way to kill the monster print ‘We are doomed!!’ (without the quotes).
    Sample Input
    2
    33
    2 3 4
    3 1 2
    4 3 2
    1 7 1
    3 4 2
    51
    3 3 1
    4 3 2
    2 3 3
    3 1 4
    5 2 3
    Sample Output
    19 33
    We are doomed!!

    貌似中途相遇法,时间2500ms

    view code
  • 相关阅读:
    Linq To Entity 的增删改查(技术储备,怕忘了) jerry
    微博内容中的短地址 分析
    使用HttpWebRequest自动更新客户端应用程序[转]
    面向对象的js编程
    获取asp.net解析页面完毕后后的html代码
    js 面向对象继承 动物叫声比赛版
    [译]C# Socket连接请求超时机制
    c# 扫描可疑文件(找到木马)(简)转
    session如何保存在专门的StateServer服务器中
    动态加载script文件 专题
  • 原文地址:https://www.cnblogs.com/zyx1314/p/3928077.html
Copyright © 2011-2022 走看看