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.
This problem is no fun to solve without a reasonable and correct constraint on the number of distinct roads there are. If the lengths are all distinct powers of 2, then there really can't be more than 64 of them without forcing the program to use arbitrary-length integers.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Roads in HackerLand
You are viewing a single comment's thread. Return to all comments →
The given constraint C_i < M is just... wrong.
This problem is no fun to solve without a reasonable and correct constraint on the number of distinct roads there are. If the lengths are all distinct powers of 2, then there really can't be more than 64 of them without forcing the program to use arbitrary-length integers.