摘要: A. Buggy Sorting贪心:只要n>2,则令最前两个为2,后面都为1B. Increase and Decrease贪心:若所有元素相加整除元素个数n,则为n,否则为n-1C. Beauty Pageant暴力:用vector存枚举到每个元素的当前所有解,没加入一个新元素,更新vector,知道个数等于kD. Colorful Graph图论:输入边时,将对应点加入,最后枚举一遍颜色,取最大E. Blood Cousins Return树:将节点按深度用vector分别存储,递归时每个节点的头\末位置分别记录,搜索v的k儿子时,利用头、末位置调用lower_bound()函数对 阅读全文
posted @ 2012-11-22 10:55 YogyKwan 阅读(261) 评论(0) 推荐(0) 编辑
摘要: C. Beauty Pageanttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGeneral Payne has a battalion ofnsoldiers. The soldiers' beauty contest is coming up, it will last forkdays. Payne decided that his battalion will participate in the pageant. No 阅读全文
posted @ 2012-11-22 10:47 YogyKwan 阅读(416) 评论(0) 推荐(0) 编辑