Binary Craziness
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Description
Walk Alone has a graph of nodes and bi-directional edges. He defines a function of $f(u, v)=(\deg_u \oplus \deg_v)(\deg_u | \deg_v)(\deg_u \& \deg_v)$, where denotes the number of edges that associated with node , and denotes bitwise xor, bitwise or and bitwise and. He wants you to calculate $\left(\sum_{i=1}^n \sum_{j=i}^n f(i, j)\right) \bmod 998\ 244\ 353$.
Format
Input
The first line of the input contains two integers () denoting the number of nodes and edges.
Each of the following lines contains two integers () representing a bi-directional edge .
The graph might have duplicated edges and self-loops. Remind that a self-loop on node will contribute to .
Output
Output a single integer denoting the answer.
Samples
6 6
1 3
2 3
1 4
2 5
3 6
4 6
30
Limitation
1s, 1024KiB for each test case.
2026 SYNU 五月周赛 Round I (Div 3)
- 状态
- 已结束
- 规则
- XCPC
- 题目
- 4
- 开始于
- 2026-5-7 19:30
- 结束于
- 2026-5-7 21:00
- 持续时间
- 1.5 小时
- 主持人
- 参赛人数
- 14