异或计算
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.
Problem Description
给定长非负整数数组,要求计算:
$$E = \sum_{i_1 = 1}^{n} \sum_{i_2 = 1}^{n} ...\sum_{i_n = 1}^{n} (a_{i_1} \oplus a_{i_2} \oplus .... \oplus a_{i_n} )$$例如:
当时,$E = \sum_{i_1 = 1}^{2} \sum_{i_2 = 1}^{2} (a_{i_1} \oplus a_{i_2}) = a_1 \oplus a_1 + a_1 \oplus a_2 + a_2 \oplus a_1 + a_2 \oplus a_2$.
Input Format
第一行输入一个正整数
第二行输入个非负整数,依次代表 。
Output Format
输出 对 取模的结果,即 % 其中 .
Sample
输入 # 1
3
3 1 3
输出 # 1
55
重庆邮电大学第十九届ACM程序设计大赛(现场赛)
- Status
- Done
- Rule
- XCPC
- Problem
- 11
- Start at
- 2025-3-22 13:10
- End at
- 2025-3-22 18:10
- Duration
- 5 hour(s)
- Host
- Partic.
- 3