You are viewing a single comment's thread. Return to all comments →
What's wrong with this?
def solve(n, k): if n <= 4*k: return n-1 else: a = math.sqrt(n) b = math.sqrt(n-4*k) c = a*(a-b)/2 return 2*int(c)
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Counting
You are viewing a single comment's thread. Return to all comments →
What's wrong with this?
def solve(n, k): if n <= 4*k: return n-1 else: a = math.sqrt(n) b = math.sqrt(n-4*k) c = a*(a-b)/2 return 2*int(c)