We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Actually, it just doesn't fit inside an int. It's all there in the problem statement. q <= L^2 and L<=10^9, so q<=10^18. LONG_MAX in this environment is 9223372036854775807, so that is juuuust sufficient.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Moving Tiles
You are viewing a single comment's thread. Return to all comments →
Actually, it just doesn't fit inside an int. It's all there in the problem statement. q <= L^2 and L<=10^9, so q<=10^18. LONG_MAX in this environment is 9223372036854775807, so that is juuuust sufficient.