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

建议使用的浏览器:

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

6132:Mystery

题目描述
$Hazel$ would like to find out everything about the binary tree.
She has a **full** binary tree ,each point has different labels.
regarding each point of tree ,$Hazel$ defines its height $h_i$ being the number of points which the shortest path from this point to a leaf has.
each point has weight $A_i$ which be defined as $X^{h_i}$.
$Hazel$ wants to paint every points by color $B_i$,Observing the following rules:
$\bullet\ \forall i\in T,B_i\in N$
$\bullet\ \forall i\in T,B_i\ge B_{fa_i}$
$\bullet\ Y\ge 2\times \sum_{i\in leaf} B_i-\sum_{i\in T}B_i$
(define $B_{fa_{root}}=0$ )
$Hazel$ defines the contribution of the tree $S$ as $\sum_{i\in T}A_i\times B_i$.
She wants to know how many legal methods can she paint the tree,which cause $S$ is multiple of $P$.
You need to print $ans \ mod (10^9+7)$.
输入解释
4 positive integer$H$,$X$,$Y$,$P$($1\le H\le 10^{18}$,$1\le X\le 500$,$0\le Y\le 10$,$1\le P\le 500$,$P$ is a prime number).
$H$means the tree has$2^H-1$ points.
输出解释
an integer showing $ans \ mod (10^9+7)$.
输入样例
2
8 10 7 11
34819237827249996 146 5 349
输出样例
630072624
673102984
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6132

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

共提交 0

通过率 --%
时间上限 内存上限
3000/1500MS(Java/Others) 524288/524288K(Java/Others)