#abc288h. Ex - A Nameless Counting Problem
Ex - A Nameless Counting Problem
Score : points
问题描述
输出满足以下两个条件的整数序列长度为 的序列 的个数,结果对 取模。
此处, 表示按位异或运算。
什么是按位异或运算?
非负整数 和 的按位异或运算(记作 )定义如下:
- 当 以二进制表示时,第 位最低位()在以下情况下为 : 和 的第 位最低位中恰好有一个是 ;否则为 。
例如,(二进制表示:)。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Print the number of integer sequences of length , , that satisfy both of the following conditions, modulo .
Here, denotes bitwise XOR.
What is bitwise XOR?
The bitwise XOR of non-negative integers and , , is defined as follows.
- When is written in binary, the -th lowest bit () is if exactly one of the -th lowest bits of and is , and otherwise.
For instance, (in binary: ).
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3 3 2
Sample Output 1
5
Here are the five sequences of length that satisfy both conditions in the statement: $(0, 0, 2), (0, 1, 3), (1, 1, 2), (2, 2, 2), (2, 3, 3)$.
Sample Input 2
200 900606388 317329110
Sample Output 2
788002104
update @ 2024/3/10 12:03:19