#P10128. 「Daily OI Round 3」Xor Graph
「Daily OI Round 3」Xor Graph
Background
Before dawn arrives, someone must light up the darkness.
Problem Description
Xs_siqi gives you vertices. There is a directed edge from to if and only if , , and . Here, means bitwise XOR, and is an integer. Let be the number of different paths from vertex to vertex . Find:
Output the answer modulo .
Input Format
The first line contains an integer .
The next lines (lines to ) each contain an integer .
Output Format
Output lines. Each line contains an integer representing the number of valid paths required by the problem.
4
2
3
50
999998
2
15
599192517
81627972
Hint
Sample Explanation #1
For the first test case of the sample, vertex has edges to and . Then there is one path from to and one path from to , for a total of paths.
Constraints
For all testdata: , .
Translated by ChatGPT 5