摘要: 题意:有一串数字,要将它排列成升序,每次可以交换两个数,交换一次的代价为两数之和。要求代价最小。思路:读完题,没有思路,知道是关于polya的,但是也只会最简单的求有多少种染色方法,然后上网搜题解,再然后参考大神的题解,终于明白了,还是要继续学习polya啊,大神的博客:http://www.cnblogs.com/mcflurry/archive/2012/06/21/2557798.html代码:View Code #include <stdio.h>#include <stdlib.h>#include <string.h>#include <i 阅读全文
posted @ 2012-08-18 20:19 Misty_1 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 关于polya的定义网上可以搜到很多,我所了解的也是从网上搜到的,不过可以介绍几个博客,个人觉得讲的还不错。1、关于polya的定义,http://blog.csdn.net/geniusluzh/article/details/67954122、将这两道题的,http://yzmduncan.iteye.com/blog/1402942如果还不懂得话,推荐看一下吴文虎的《组合数学》里的置换群那一节,对于求循环节很有帮助。1286代码:View Code #include <stdio.h>#include <stdlib.h>#include <string.h 阅读全文
posted @ 2012-08-18 19:35 Misty_1 阅读(393) 评论(0) 推荐(0) 编辑