Rezultati

Up. imeNalogaJezikRezultatČas oddaje
boku-yes-pico-2019 Ocenjevanje univerz Python 3 100/100OK 24. apr '19 @ 17:55

Test Točke Porabljen spomin Porabljen čas Status
#1 [več] 10/10 20,012 MiB 0,157 s OK
#2 [več] 10/10 29,645 MiB 0,660 s OK
#3 [več] 10/10 8,676 MiB 0,000 s OK
#4 [več] 10/10 20,375 MiB 0,157 s OK
#5 [več] 10/10 13,766 MiB 0,000 s OK
#6 [več] 10/10 20,508 MiB 0,228 s OK
#7 [več] 10/10 32,316 MiB 0,765 s OK
#8 [več] 10/10 32,246 MiB 0,715 s OK
#9 [več] 10/10 12,180 MiB 0,000 s OK
#10 [več] 10/10 8,707 MiB 0,083 s OK

Ocenjevani program (univerze.py):
def main():
    n = int(input())
    master = list(map(int, input().split(' ')))
    lst = []
    for i in range(n-1):
        tmp = list(map(int, input().split(' ')))
        if tmp[0] > master[0] and tmp[1] > master[1]:
            return "Slabe metrike"
        if tmp[0] <= master[0] and tmp[1] <= master[1] or master[0] - master[1] == tmp[0] - tmp[1]:
            continue
        else:
            lst.append(tmp)

    x = 0.5
    epsilon = 1e-6
    a,b = master
    x_min = 0
    x_max = 1
    for ai, bi in lst:
        xi = (bi - b) / (a - b - ai + bi)
        if a - b > ai - bi:
            x_min = max(x_min, xi)
        else:
            x_max = min(x_max, xi)
        if x_min > x_max:
            return "Slabe metrike"

    return "{} {}".format((x_min + x_max) * 0.5, 1 - (x_min + x_max) * 0.5) 
print(main())