异或
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
[丛雨]有一个数列 。有一天,[芳乃]拿来了一个正整数 。丛雨是一个特别喜欢异或(xor
)运算的孩子,她也很喜欢芳乃。于是,丛雨就想知道,自己能找到多少对数 能够满足 。 两个数对 与 不同,当且仅当 或者 。
提示:异或运算在C++里的算符是 ^
。
输入格式(xor.in)
第一行两个正整数 , ,分别表示数列的长度以及芳乃带来的整数。 第二行包含 个正整数,表示数列 。
输出格式(xor.out)
一行一个整数表示答案。
输入样例
5 1
1 4 2 2 5
输出样例
2
样例解释
因为 ,所以这两个数对是 和 。
数据范围
对于 的数据, 。 对于接下来 的数据, 。 对于 的数据,$1 \le n \le 1000000, 1 \le a_i \le 2^{30}, 1 \le X \le 2^{30}$ 。
0715测试
- Status
- Done
- Rule
- IOI
- Problem
- 4
- Start at
- 2024-7-15 14:00
- End at
- 2024-7-15 17:30
- Duration
- 3.5 hour(s)
- Host
- Partic.
- 30