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

建议使用的浏览器:

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

6712:sakura

题目描述
There is an infinite 3D value grid space $a_{i,j,k}$. Initially, for $ \forall i,j,k \ a_{i,j,k}$ = 1. First, we change the value of $m$ grids. In the $i-th$ operation, we change the value of $a_{n, x_i, y_i}$ from 1 to $v_i$. Then the grid in the space will change every second. The value of the grid $a_{i,j,k}$ will change to $a_{i+1,j+p,k} ^ {t1} \times a_{i+1,j,k+q} ^ {t2} \times a_{i+1,j,k} \times a_{i,j,k}$ for every second.
We want to know $a_{0,0,0} mod \ 998244353$ after $n$ seconds.
输入解释
There are several test cases in the input file.
In the each test case, the first line contains six integers $t1,t2,p,q,n,m (1 \leq t1,t2,p,q,n \leq 10^9, 1 \leq m \leq 10 ^ 5)$.
The $i-th$ line in the next $m$ lines contains three integers $x_i, y_i, v_i (0 \leq x_i,y_i \leq 10^9, \ 1 \leq v_i \leq 10^9)$
It is guaranteed that $\sum m \leq 2*10^5$ and for $ \forall i,j (\ i \neq j) ; \ x_i \neq x_j \ or \ y_i \neq y_j$ in each test case.
输出解释
For each test case, print a single line containing an integer, denoting the value of $a_{0,0,0} \ mod \ 998244353$ after $n$ seconds.
输入样例
1 1 1 1 2 6
0 0 2
0 1 3
0 2 4
1 0 4
1 1 2
2 0 2
输出样例
9216
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6712

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

共提交 0

通过率 --%
时间上限 内存上限
4000/4000MS(Java/Others) 262144/262144K(Java/Others)