hdu
lzr010506
OI党
展开
-
hdu Kth number
Problem Description Give you a sequence and ask you the kth big number of a inteval. Input The first line is the number of the test cases. For each test case, the first line contain t原创 2016-03-02 19:23:19 · 424 阅读 · 0 评论 -
hdu 1538 海盗分金币
Problem Description A bunch of pirates have gotten their hands on a hoard of gold pieces and wish to divide the loot. They are democratic pirates in their own way, and it is their custom to make su原创 2016-02-24 09:42:19 · 590 阅读 · 0 评论 -
hdu2157 How many ways?
题目大意:给定一个有向图,问从A点恰好走k步(允许重复经过边)到达B点的方案数mod p的值把 给定的图转为邻接矩阵,即A(i,j)=1当且仅当存在一条边i->j。令C=A*A,那么C(i,j)=ΣA(i,k)*A(k,j),实际上就 等于从点i到点j恰好经过2条边的路径数(枚举k为中转点)。类似地,C*A的第i行第j列就表示从i到j经过3条边的路径数。同理,如果要求经过k步的 路径数,我们只需要二原创 2016-04-13 09:04:23 · 337 阅读 · 0 评论