Rezultati

Up. imeNalogaJezikRezultatČas oddaje
moh-in-o-oklepajfenikszaklepaj-2019 Ocenjevanje univerz Python 3 100/100OK 24. apr '19 @ 17:28

Test Točke Porabljen spomin Porabljen čas Status
#1 [več] 10/10 12,465 MiB 0,000 s OK
#2 [več] 10/10 15,793 MiB 0,335 s OK
#3 [več] 10/10 13,262 MiB 0,269 s OK
#4 [več] 10/10 12,402 MiB 0,017 s OK
#5 [več] 10/10 10,273 MiB 0,000 s OK
#6 [več] 10/10 12,570 MiB 0,012 s OK
#7 [več] 10/10 16,211 MiB 0,512 s OK
#8 [več] 10/10 16,281 MiB 0,542 s OK
#9 [več] 10/10 9,734 MiB 0,000 s OK
#10 [več] 10/10 11,777 MiB 0,108 s OK

Ocenjevani program (ocenjevanje_univerz.py):
n = int(input())

in_val = input().split()
a0 = int(in_val[0])
b0 = int(in_val[1])
c0 = a0 - b0

c_list = []
b_list = []

for i in range(n - 1):
    in_val = input().split()
    a = int(in_val[0])
    b = int(in_val[1])
    c = a - b
    c_list.append(c0 - c)
    b_list.append(b0 - b)

x_min = 1
x_max = 0

found_bad_statistic = 0

for i in range(len(b_list)):
    b = b_list[i]
    c = c_list[i]

    if ((c < 0 and b <= 0) or (c <= 0 and b < 0)):
        found_bad_statistic = 1
        break
    elif (c >= 0 and b >= 0):
        pass
    elif (b < 0 and c > 0):
        if x_max < - b / c:
            x_max = - b / c
    elif (b > 0 and c < 0):
        if x_min > - b / c:
            x_min = - b / c

if (found_bad_statistic != 0):
    print("Slabe metrike")

elif x_min < x_max:
    print("Slabe metrike")

else:
    x = 1. / 2. * (x_min + x_max)
    y = 1 - x
    print(str(x) + " " + str(y))