异或
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.
题目描述
小Z有一个数列 。有一天,徐老师拿来了一个正整数 。小Z是一个特别喜欢异或(xor)运算的孩子,她也很喜欢徐老师。于是,小Z就想知道,自己能找到多少对数 能够满足 。 两个数对 与 不同,当且仅当 或者 。
提示:异或运算在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}$ 。
2025年入门组测试11(5月31日)
- Status
- Done
- Rule
- IOI(Strict)
- Problem
- 3
- Start at
- 2025-5-30 14:30
- End at
- 2025-6-1 6:30
- Duration
- 40 hour(s)
- Host
- Partic.
- 6