当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6596:Fantastic Magic Cube

题目描述
You are given a positive integer $N$ and a set of six-tuples. We define the value of a six-tuple $(l_x, r_x, l_y, r_y, l_z, r_z)$ is $\sum\limits_{l_x \leq x \leq r_x, l_y \leq y \leq r_y, l_z \leq z \leq r_z, }{x \oplus y \oplus z}$. In the beginning, the set has only an element $(0, N - 1, 0, N - 1, 0, N - 1)$. You can do the following steps repeatedly until the size of $S$ equals to $N^3$:

$\bullet$ Pick a six-tuple $(l_x, r_x, l_y, r_y, l_z, r_z)(l_x < r_x \; or \; l_y < r_y \; or \; l_z < r_z)$ from the set.

$\bullet$ You can choose one element of $\left\{ x, y, z \right\} $.

$\space\space\space\space\circ$ Assuming you chose $x$, it must be satisfied that $l_x < r_x$. Then you should pick an integer $t \in [l_x, r_x)$, erase $(l_x, r_x, l_y, r_y, l_z, r_z)$ from the set, add
$\space\space\space\space\space\space$ $(l_x, t, l_y, r_y, l_z, r_z)$ and $(t + 1, r_x, l_y, r_y, l_z, r_z)$ into the set, and you will get the product of values of these two new six-tuples.

$\space\space\space\space\circ$ Assuming you chose $y$, it must be satisfied that $l_y < r_y$. Then you should pick an integer $t \in [l_y, r_y)$, erase $(l_x, r_x, l_y, r_y, l_z, r_z)$ from the set, add
$\space\space\space\space\space\space$ $(l_x, r_x, l_y, t, l_z, r_z)$ and $(l_x, r_x, t + 1, r_y, l_z, r_z)$ into the set, and you will get the product of values of these two new six-tuples.

$\space\space\space\space\circ$ Assuming you chose $z$, it must be satisfied that $l_z < r_z$. Then you should pick an integer $t \in [l_z, r_z)$, erase $(l_x, r_x, l_y, r_y, l_z, r_z)$ from the set, add
$\space\space\space\space\space\space$ $(l_x, r_x, l_y, r_y, l_z, t)$ and $(l_x, r_x, l_y, r_y, t + 1, r_z)$ into the set, and you will get the product of values of these two new six-tuples.

Maximize the sum of values you got and output it modulo $998244353$.

Note that $\oplus$ means exclusive or, for more details refer to https://en.wikipedia.org/wiki/Exclusive_or.
输入解释
There are multiple test cases.

Each case starts with a line containing one positive integer $N(N \leq 10^6)$.

We guarantee that the sum of $N$s in all test cases is no larger than $3 \times 10^6$.
输出解释
For each test case, output one line containing an integer denoting the answer.
输入样例
2
输出样例
6
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6596

最后修改于 2020-10-25T23:32:40+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 131072/131072K(Java/Others)