Sort by

recency

|

1838 Discussions

|

  • + 0 comments

    seems the answer to the question is wrong even though it passed the test cases. the question askes to sort the result in ascendign order, which implies, at least to me, that the resulting list should be sorted in increasing order of the sum of its sub lists. when the list is sorted, the answer fails some test cases.

  • + 0 comments

    if name == 'main': x = int(input()) y = int(input()) z = int(input()) n = int(input())

    not_sum = [[i,j,k] for i in range(x+1) for j in range(y+1) for k in range(z+1) if i+j+k != n]

    print(not_sum)

  • + 0 comments

    if __name__ == '__main__':
        x = int(input())
        y = int(input())
        z = int(input())
        n = int(input())
    l = []   
    for _ in range(z+1):
        l.append([0,0,_])
    
    for _ in range(y+1):
        for __ in range(z+1):
            if [0,_,__] not in l:
                l.append([0,_,__])
    
    for _ in range(x+1):
        for __ in range(y+1):
            for ___ in range(z+1):
                if [_,__,___] not in l:
                    l.append([_,__,___])
    
    
    
    final_corord = [ _ for _ in l if sum(_) !=n ]
    print(final_corord
    
  • + 0 comments
    if __name__ == '__main__':
        x = int(input())
        y = int(input())
        z = int(input())
        n = int(input())
        print([[i,j,k] for i in range(x+1) for j in range(y+1) for k in range(z+1) if(i+j+k) != n ])
       
    
  • + 0 comments

    For Python3 Platform

    x = int(input())
    y = int(input())
    z = int(input())
    n = int(input())
    
    res = [[i, j, k] for i in range(x+1) for j in range(y+1) for k in range(z+1) if (i+j+k) != n]
    
    print(res)