Sort by

recency

|

297 Discussions

|

  • + 0 comments

    def movingTiles(l, s1, s2, queries):

    F = [] 
    for i in queries:
    
          Q_slope = math.sqrt(i + i)
          S_Diagonal = math.sqrt(l**2 + l**2)
          F.append((S_Diagonal-Q_slope)/abs(s1-s2))
    return (F)
    
  • + 0 comments

    Haha C# has a similar issue. The areas may be up to length^2, but that means they need to be long. So, you'll need to modify the supplied ingestion code.

  • + 0 comments

    Fix your dogshit scala example by changing the queries input into a Double

  • + 0 comments

    Note for people trying in C: the parse_int function overflows for some test cases. Change the function to return a long, and change the queries array to accept longs.

  • + 0 comments
        res=[]
        for query in queries:
            res.append( (l*math.sqrt(2)-math.sqrt(query)*math.sqrt(2))/(abs(s1-s2)) )
        return res