Submission #1089455

#TimeUsernameProblemLanguageResultExecution timeMemory
1089455vjudge1Bank (IZhO14_bank)Cpython 3
Compilation error
0 ms0 KiB
    n, m = map(int, input().split())
        
    valores = list(map(int, input().split()))
    notas = list(map(int, input().split()))
     
    residual = [-1] * (1 << m)
    cobertos = [-1] * (1 << m)
     
    residual[0] = 0
    cobertos[0] = 0
     
    possivel = 0
     
    for s in range(1 << m):
        for p in range(m):
            if (s & (1 << p)) == 0:
                continue
     
            ant = s & ~(1 << p)
     
            if cobertos[ant] == -1:
                continue
     
            novo = residual[ant] + notas[p]
            
            if cobertos[ant] < n:
                alvo = valores[cobertos[ant]]
            else:
                continue
     
            if novo < alvo:
                cobertos[s] = cobertos[ant]
                residual[s] = novo
     
            elif novo == alvo:
                cobertos[s] = cobertos[ant] + 1
                residual[s] = 0
     
        if cobertos[s] == n:
            possivel = 1
     
    if possivel == 1:
        print("YES")
    else:
        print("NO")

Compilation message (stderr)

Sorry: IndentationError: unexpected indent (bank.py, line 1)