Sort by

recency

|

12 Discussions

|

  • + 0 comments

    Looks like default reading in python3 is incorrect. I've tried the following code with test case #6

    #!/bin/python3
    
    import sys
    
    if __name__ == "__main__":
        n, m, x, k = input().strip().split(' ')
        n, m, x, k = [int(n), int(m), int(x), int(k)]
        a = list(map(int, input().strip().split(' ')))
        b = list(map(int, input().strip().split(' ')))
        # Write Your Code Here
        print(n, m, x, k)
        print(len(a),len(b))
    

    the output on my computer is:

    1000 2000 1000 206630
    588 595
    

    instead of expected

    1000 2000 1000 206630
    1000 2000
    
  • + 1 comment

    Disappointed that the C++ boilerplate solution still uses int vars, when the constraints obviously required something else.

    Awarding 20% points because I've discovered the bug in the boilerplate?? I expected better.

    With respect: your problems are interesting, and I suspect good examples of exploring problem spaces. But I believe your descriptions are too terse. When I have fifteen minutes to solves a problem (HackHour 24), but still cannot understand the simpler problems after 5 minutes? Agree, I probably need to study the algorithm space more ... and am happy to research. But in 10 minutes? It becomes not a test of skill, but of specific domain knowledge. I think the questions are obfuscated, and ask that you vet them a little more.

  • + 1 comment

    generate_list function in Python would be:

    def generate_list(A, B, n, m, x):
        L = []
    
        for i in xrange(min(n, m - x)):
            for j in xrange((i + x), m):
                L.append(A[i]*B[j])
                
        return L
    

    Do I have to optimize this part as well? Or leave it as it is? I only passed 11 test cases using sort and heapq (I changed append to heappush).

  • + 0 comments

    I still have a question: is there an error in "explanation 0"? why is list B iterated from 3rd element instead of 2nd? )

  • + 0 comments

    Using min-heap and then popping doesn't make the cut either. ;-(