One Person GameTime Limit:1 Second Memory Limit:32768 KB Special JudgeThere is a very simple and interesting one-person game. You have 3 dice, namelyDie1,Die2andDie3.Die1hasK1faces.Die2hasK2faces.Die3hasK3faces. All the dice are fair dice, so the probability of rolling each value, 1 toK1,K2,K3is exa Read More
posted @ 2012-03-21 21:28 Because Of You Views(462) Comments(0) Diggs(0) Edit
题意:一幅图,至多有一个点的度数大于2,,然后有三种操作,给每条边染成黑色或白色,询问两个点间的黑色路径的距离是多少(即两个点有黑色路径相连而成)。找出那个度数大于2的点,没有的话就是一条链。有几个度就有几条链,对于每个操作,找到每个点相应的链,和这个点是这条链上的第几个点,用树状数组做就可以了。考察图的模拟,二维树状数组或线段树学习了别人的代码View Code #include<cstdio>#include<cstring>#include<vector>#include<cstdlib>#include<algorithm>u Read More
posted @ 2012-03-21 13:24 Because Of You Views(395) Comments(0) Diggs(0) Edit