Rezultati

Up. imeNalogaJezikRezultatČas oddaje
muzik-2017 Pakiranje piva Python 3 100/100OK 20. apr '17 @ 19:43

Test Točke Porabljen spomin Porabljen čas Status
#1 3/3 8,684 MiB 0,000 s OK
#2 3/3 8,727 MiB 0,000 s OK
#3 3/3 8,691 MiB 0,000 s OK
#4 3/3 8,629 MiB 0,000 s OK
#5 3/3 11,125 MiB 0,000 s OK
#6 3/3 8,617 MiB 0,000 s OK
#7 3/3 8,648 MiB 0,000 s OK
#8 3/3 10,352 MiB 0,000 s OK
#9 3/3 8,691 MiB 0,000 s OK
#10 3/3 8,688 MiB 0,000 s OK
#11 3/3 8,629 MiB 0,000 s OK
#12 3/3 8,688 MiB 0,000 s OK
#13 3/3 8,629 MiB 0,000 s OK
#14 3/3 11,184 MiB 0,000 s OK
#15 3/3 8,629 MiB 0,000 s OK
#16 3/3 8,605 MiB 0,000 s OK
#17 3/3 11,164 MiB 0,000 s OK
#18 3/3 8,625 MiB 0,000 s OK
#19 3/3 11,160 MiB 0,000 s OK
#20 3/3 8,836 MiB 0,000 s OK
#21 3/3 11,164 MiB 0,000 s OK
#22 3/3 9,266 MiB 0,000 s OK
#23 3/3 9,297 MiB 0,000 s OK
#24 3/3 9,488 MiB 0,000 s OK
#25 4/4 10,137 MiB 0,000 s OK
#26 4/4 8,746 MiB 0,000 s OK
#27 4/4 8,852 MiB 0,000 s OK
#28 4/4 8,707 MiB 0,000 s OK
#29 4/4 8,707 MiB 0,000 s OK
#30 4/4 8,785 MiB 0,000 s OK
#31 4/4 8,789 MiB 0,000 s OK

Ocenjevani program (per.py):
import sys

inp = sys.stdin

#inp = open("flase.in")

N = int(inp.readline())

flase = []

for flasa in range(N):
    flase.append(int(inp.readline().strip()))

#print (flase)
m = min(flase)
#m = 128
possible = []
#print (possible)

for st_skatel in range(1, int(m**(0.5)) + 1):
    if (m % st_skatel == 0):
        possible.append(m // st_skatel + 1)
        possible.append(m//st_skatel)

    else:
        possible.append(m//st_skatel + 1)

for velikost_skatle in range(int(m**(0.5)) + 1, 0, -1):
    possible.append(velikost_skatle)

#print(possible)

def check(skatla, st_flas):
    if st_flas % skatla == 0:
        return True
    stPolnenj = st_flas//skatla + 1
    ostanek = stPolnenj * skatla - st_flas
    if ostanek <= stPolnenj:
        return True
    return False
    """
    m = st_flas % skatla
    if not m:
        return True
    ost = skatla - m

    if ost <= st_flas//skatla + 1:
        return True
    return False
    """
a = 0
for skatla in possible:
    if skatla == 2:
        break
    #print(j)
    for fl in flase:
        #print("   ", fl)
        if not check(skatla, fl):
            break
    else:
        a = skatla
        break

if a == 0:
    print(2)
else:
    print(a)