GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Sunday, 24 July 2022

[Solution] XOR Triangle Codeforces Solution 2022



E. XOR Triangle
time limit per test
4 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

You are given a positive integer n. Since n may be very large, you are given its binary representation.

You should compute the number of triples (a,b,c) with 0a,b,cn such that abbc, and ac are the sides of a non-degenerate triangle.

Here,  denotes the bitwise XOR operation.

You should output the answer modulo 998244353.

Solution Click Below:-  👉CLICK HERE👈
👇👇👇👇👇

Three positive values xy, and z are the sides of a non-degenerate triangle if and only if x+y>zx+z>y, and y+z>x.

Input

The first and only line contains the binary representation of an integer n (0<n<2200000) without leading zeros.

For example, the string 10 is the binary representation of the number 2, while the string 1010 represents the number 10.

Output

Print one integer — the number of triples (a,b,c) satisfying the conditions described in the statement modulo 998244353.

No comments:

Post a Comment