{"problem":{"name":"Many Xor Optimization Problems","description":{"content":"PCT made the following problem. > **Xor Optimization Problem**You are given a sequence of non-negative integers of length $N$: $A_1,A_2,...,A_N$. When it is allowed to choose any number of elements i","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":8000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc139_f"},"statements":[{"statement_type":"Markdown","content":"PCT made the following problem.\n\n> **Xor Optimization Problem**You are given a sequence of non-negative integers of length $N$: $A_1,A_2,...,A_N$. When it is allowed to choose any number of elements in $A$, what is the maximum possible $\\mathrm{XOR}$ of the chosen values?\n\nNyaan thought it was too easy and revised it to the following.\n\n> **Many Xor Optimization Problems**There are $2^{NM}$ sequences of length $N$ consisting of integers between $0$ and $2^M-1$. Find the sum, modulo $998244353$, of the answers to **Xor Optimization Problem** for all those sequences.\n\nSolve **Many Xor Optimization Problems**.\nWhat is bitwise $\\mathrm{XOR}$?The bitwise $\\mathrm{XOR}$ of non-negative integers $A$ and $B$, $A \\oplus B$, is defined as follows:\n\n*   When $A \\oplus B$ is written in base two, the digit in the $2^k$'s place ($k \\geq 0$) is $1$ if exactly one of $A$ and $B$ is $1$, and $0$ otherwise.\n\nFor example, we have $3 \\oplus 5 = 6$ (in base two: $011 \\oplus 101 = 110$).  \nGenerally, the bitwise $\\mathrm{XOR}$ of $k$ non-negative integers $p_1, p_2, p_3, \\dots, p_k$ is defined as $(\\dots ((p_1 \\oplus p_2) \\oplus p_3) \\oplus \\dots \\oplus p_k)$. We can prove that this value does not depend on the order of $p_1, p_2, p_3, \\dots, p_k$.\n\n## Constraints\n\n*   $1 \\le N,M \\le 250000$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $M$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc139_f","tags":[],"sample_group":[["2 1","3\n\nWe are to solve **Xor Optimization Problem** for all sequences of length $2$ consisting of integers between $0$ and $1$.\n\n*   The answer for $A=(0,0)$ is $0$.\n*   The answer for $A=(0,1)$ is $1$.\n*   The answer for $A=(1,0)$ is $1$.\n*   The answer for $A=(1,1)$ is $1$.\n\nThus, the final answer is $0+1+1+1=3$."],["3 4","52290"],["1234 5678","495502261"]],"created_at":"2026-03-03 11:01:13"}}