Rezultati

Up. imeNalogaJezikRezultatČas oddaje
kosmati-mucki-2019 Ocenjevanje univerz Python 3 0/100Napaka med izvajanjem / ob izhodu (RTE) 24. apr '19 @ 19:21

Test Točke Porabljen spomin Porabljen čas Status
#1 [več] 10/10 14,105 MiB 0,220 s OK
#2 [več] 10/10 18,582 MiB 0,775 s OK
#3 [več] 10/10 8,668 MiB 0,000 s OK
#4 [več] 10/10 14,422 MiB 0,230 s OK
#5 [več] 10/10 11,352 MiB 0,000 s OK
#6 [več] 10/10 14,395 MiB 0,250 s OK
#7 [več] 0/10 20,063 MiB 0,845 s Napačen odgovor
#8 [več] 0/10 20,215 MiB 0,881 s Napačen odgovor
#9 [več] 0/10 10,336 MiB 0,000 s Napačen odgovor
#10 [več] 0/10 8,539 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 38, in <module>
    M = min(R)
ValueError: min() arg is an empty sequence

Ocenjevani program (univerze.py):
n = int(input())
a1,b1 = map(int, input().split())

def f(x):
    kaji = []
    for i in range(len(A)-1):
        kaji.append((A[i]-B[i])*x + B[i])
    return (a1-b1)*x + b1 - max(kaji)

A = []
B = []
meh = 0
for i in range(n-1):
    a,b = map(int, input().split())
    if (a1 < a) and (b1 < b):
        print("Slabe metrike")
        meh = 1
        break
    if not((a < a1) and (b < b1)):
        A.append(a)
        B.append(b)

if not meh:
    m = len(A)
    L = [0 for _ in range(m)]
    R = [1 for _ in range(m)]
    for i in range(len(A)):
        x = (B[i] - b1)/(a1 - A[i] - b1 + B[i])
        if x > 0:
            if ((a1 - b1)*x/2 + b1) > ((A[i] - B[i])*x/2 + B[i]):
                R[i] = min([1, x])
            else:
                L[i] = max([0, x])
        else:
            if not ((a1 - b1)/2 + b1) > ((A[i] - B[i])/2 + B[i]):
                R[i] = -1

    M = min(R)
    m = max(L)
    if (M - m) > 0:
        x = (M+m)/2
        print(x, 1-x)