zoukankan      html  css  js  c++  java
  • TL(简单)

    TL
    time limit per test
    2 seconds
    memory limit per test
    256 megabytes
    input
    standard input
    output
    standard output

    Valera wanted to prepare a Codesecrof round. He's already got one problem and he wants to set a time limit (TL) on it.

    Valera has written n correct solutions. For each correct solution, he knows its running time (in seconds). Valera has also wrote m wrong solutions and for each wrong solution he knows its running time (in seconds).

    Let's suppose that Valera will set v seconds TL in the problem. Then we can say that a solution passes the system testing if its running time is at most v seconds. We can also say that a solution passes the system testing with some "extra" time if for its running time, a seconds, an inequality 2a ≤ v holds.

    As a result, Valera decided to set v seconds TL, that the following conditions are met:

    1. v is a positive integer;
    2. all correct solutions pass the system testing;
    3. at least one correct solution passes the system testing with some "extra" time;
    4. all wrong solutions do not pass the system testing;
    5. value v is minimum among all TLs, for which points 1234 hold.

    Help Valera and find the most suitable TL or else state that such TL doesn't exist.

    纯粹找水题练练python。。。

     1 def getVar(): 
     2     return tuple(map(int, input().split()))
     3 
     4 n, m = getVar()
     5 a = getVar()
     6 b = getVar()
     7 c = max(min(a) * 2, max(a))
     8 d = min(b) - 1
     9 if c > d:
    10     c = -1
    11 print(c)
  • 相关阅读:
    解决淘淘第三天无法显示图片
    包名与工程名
    明明有这个类却提示出错
    出错,网页显示不出内容
    配置域名
    本地jar包添加到maven仓库
    POJ1704 Georgia and Bob 博弈论 尼姆博弈 阶梯博弈
    POJ 2960 S-Nim 博弈论 sg函数
    sg函数总结
    POJ 2425 A Chess Game 博弈论 sg函数
  • 原文地址:https://www.cnblogs.com/cszlg/p/3349544.html
Copyright © 2011-2022 走看看