[Solution] XOR Triangle Codeforces Solution 2022
You are given a positive integer . Since may be very large, you are given its binary representation.
You should compute the number of triples with such that , , and are the sides of a non-degenerate triangle.
Here, denotes the bitwise XOR operation.
You should output the answer modulo .
Three positive values , , and are the sides of a non-degenerate triangle if and only if , , and .
The first and only line contains the binary representation of an integer () without leading zeros.
For example, the string 10 is the binary representation of the number , while the string 1010 represents the number .
Print one integer — the number of triples satisfying the conditions described in the statement modulo .
No comments:
Post a Comment