黑书P204的例题。
最重要的思想是
八个定点先染色,相邻两点颜色不同,每次操作必然同时改变红色和蓝色顶点,若一开始不同颜色的顶点粒子数量不同则无解。
以四个点A,B,C,D例子
先让 A B同时增加c个粒子,此时4个点粒子总数 a+c,b+c,c,d 。然后B,C同时减少c个粒子,4个点粒子分布为a+c,b,0,d.我们可以发现实际上这个操作等于将C中的粒子移动到A
假如 b,c能够消除是我们应该先采取消除操作,如果不行,才把多余的粒子按照上述方法移动到a
最终我们将所有红色的点上的粒子移动到一个顶点上,然后将所有蓝色的点移动到与之前那个点相邻的点上,最后操作即可。
1155. Troubleduons
Time limit: 0.5 second
Memory limit: 64 MB
Memory limit: 64 MB
Archangel of the Science is reporting:
“O, Lord! Those physicists on the Earth have discovered a new elementary particle!”
“No problem, we’ll add another parameter to the General Equation of the Universe.”
“O, Lord! Those physicists on the Earth have discovered a new elementary particle!”
“No problem, we’ll add another parameter to the General Equation of the Universe.”
As physics develo