Rezultati

Up. imeNalogaJezikRezultatČas oddaje
proof-is-trivial-2019 Biodiverziteta Python 3 100/100OK 09. maj '19 @ 18:13

Test Točke Porabljen spomin Porabljen čas Status
#1 [več] 20/20 23,195 MiB 2,017 s OK
#2 [več] 20/20 37,246 MiB 2,638 s OK
#3 [več] 20/20 37,258 MiB 2,430 s OK
#4 [več] 20/20 37,102 MiB 2,856 s OK
#5 [več] 20/20 37,254 MiB 2,998 s OK

Ocenjevani program (bio.py):
pr, dr, n = map(int, input().split())

niz1 = input()
niz2 = input()

s_pr = [[0,0,0,0]]
s_dr = [[0,0,0,0]]


curSez = [0,0,0,0]
for i in niz1:
    if i == "A":
        curSez[0] += 1
    elif i == "C":
        curSez[1] += 1
    elif i == "G":
        curSez[2] += 1
    elif i == "T":
        curSez[3] += 1
    s_pr.append(curSez[:])

curSez = [0,0,0,0]
for i in niz2:
    if i == "A":
        curSez[0] += 1
    elif i == "C":
        curSez[1] += 1
    elif i == "G":
        curSez[2] += 1
    elif i == "T":
        curSez[3] += 1
    s_dr.append(curSez[:])

def sezNum(string):
    s = [0,0,0,0]
    for i in string:
        if i == "A":
            s[0] += 1
        elif i == "C":
            s[1] += 1
        elif i == "G":
            s[2] += 1
        elif i == "T":
            s[3] += 1
    return s


for _ in range(n):
    s,t,u,v = map(lambda x: int(x)-1, input().split())
    dif = 0
    for i in range(4):
        dif+=abs((s_pr[t+1][i]-s_pr[s][i])-(s_dr[v+1][i]-s_dr[u][i]))
        #print((s_pr[t+1][i]-s_pr[s][i]), (s_dr[v+1][i]-s_pr[u][i]), dif)
    #print(s_pr[t+1], s_pr[s], s_dr[v+1], s_dr[u])
    print(dif)