Online Course Discussion Forum
USACO: Is there a java type that has a big capacity and can do the bitwise shift operator?
Be careful when the length of the reversal is odd; the result may be different from what you think.
If the bitwise operation for long strings of 0s and 1s is critical to your algorithm, you could write a helper class to represent that data type. In the helper class, represent the big capacity string with an array of long, and write methods for add digit, shift, complement, bitwise AND, bitwise OR, etc.
社交网络