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.
How can you make bitwise OR work?
Some of test cases have 300 digit input, that's an integer that is 2^299, that's way more than 64 bit architecture integer can represent (2^63).
When you convert a 300 characters string of "0"s and "1"s into an integer, it must get truncated. I just used bitwise OR with Haskell and got all answers wrong except the 1st test case.
I'm pretty sure it should be converted to array, not integer, or probably a dynamic bitset, if you implement it yourself or there's such thing in standard library.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
ACM ICPC Team
You are viewing a single comment's thread. Return to all comments →
How can you make bitwise OR work?
Some of test cases have 300 digit input, that's an integer that is 2^299, that's way more than 64 bit architecture integer can represent (2^63).
When you convert a 300 characters string of "0"s and "1"s into an integer, it must get truncated. I just used bitwise OR with Haskell and got all answers wrong except the 1st test case.
I'm pretty sure it should be converted to array, not integer, or probably a dynamic bitset, if you implement it yourself or there's such thing in standard library.