Rezultati

Up. imeNalogaJezikRezultatČas oddaje
veseleveverce-2018 Priprava naloge Python 3 0/100Napaka med izvajanjem / ob izhodu (RTE) 19. apr '18 @ 18:13

Test Točke Porabljen spomin Porabljen čas Status
#1 0/11 8,707 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 4, in <module>
    kok_ur_sacr = int(xx[0])
ValueError: invalid literal for int() with base 10: '<fileinput.FileInput'
#2 0/11 8,859 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 4, in <module>
    kok_ur_sacr = int(xx[0])
ValueError: invalid literal for int() with base 10: '<fileinput.FileInput'
#3 0/11 8,777 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 4, in <module>
    kok_ur_sacr = int(xx[0])
ValueError: invalid literal for int() with base 10: '<fileinput.FileInput'
#4 0/11 8,867 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 4, in <module>
    kok_ur_sacr = int(xx[0])
ValueError: invalid literal for int() with base 10: '<fileinput.FileInput'
#5 0/11 8,879 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 4, in <module>
    kok_ur_sacr = int(xx[0])
ValueError: invalid literal for int() with base 10: '<fileinput.FileInput'
#6 0/11 8,715 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 4, in <module>
    kok_ur_sacr = int(xx[0])
ValueError: invalid literal for int() with base 10: '<fileinput.FileInput'
#7 0/11 8,777 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 4, in <module>
    kok_ur_sacr = int(xx[0])
ValueError: invalid literal for int() with base 10: '<fileinput.FileInput'
#8 0/11 8,863 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 4, in <module>
    kok_ur_sacr = int(xx[0])
ValueError: invalid literal for int() with base 10: '<fileinput.FileInput'
#9 0/12 8,805 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 4, in <module>
    kok_ur_sacr = int(xx[0])
ValueError: invalid literal for int() with base 10: '<fileinput.FileInput'

Ocenjevani program (aaaaa.py):
import fileinput
lajn = str(fileinput.input())
xx = lajn.split(" ")
kok_ur_sacr = int(xx[0])
n = int(xx[1])
tji = []
pji = []
for i in range(n):
    x = fileinput.input()
    t, p = x.split(" ")
    tji.append(int(t))
    pji.append(int(p))

if sum(tji) < kok_ur_sacr:
    print("Tekma bo polom")
else:
    max, j, sum_t, sum_p = 0, 0, 0, 0
    maxp = 0
    ost = sum(tji)

    for i in range(n):
        while ost > kok_ur_sacr and j < n:
            if ost - tji[j] < kok_ur_sacr:
                break
            ost -= tji[j]
            sum_p += pji[j]
            j += 1
        if sum_p > max:
            max = sum_p
        sum_p = 0
        j = i
        ost = sum(tji)

    print(max)