摘要: P1880 [NOI1995]石子合并 题目描述 在一个圆形操场的四周摆放N堆石子,现要将石子有次序地合并成一堆.规定每次只能选相邻的2堆合并成新的一堆,并将新的一堆的石子数,记为该次合并的得分。 试设计出1个算法,计算出将N堆石子合并成1堆的最小得分和最大... 阅读全文
posted @ 2018-01-20 16:12 WenOI 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 又多了一篇总结。 迷宫问题 描述 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1... 阅读全文
posted @ 2018-01-20 15:22 WenOI 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Blah数集 描述 大数学家高斯小时候偶然间发现一种有趣的自然数集合Blah,对于以a为基的集合Ba定义如下: (1) a是集合Ba的基,且a是Ba的第一个元素; (2)如果x在集合Ba中,则2x+1和3x+1也都在集合Ba中; (3)没有其他元素在集合Ba中了... 阅读全文
posted @ 2018-01-20 15:21 WenOI 阅读(957) 评论(0) 推荐(0) 编辑
摘要: 就是简单的链表操作,下面是实例。#include#include#include#include#include#includeusing namespace std;int tot;struct node { int num; node() { ... 阅读全文
posted @ 2018-01-20 15:21 WenOI 阅读(108) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#include#includeusing namespace std;int n;int data[1025];int dg(int l,int r) { if(l == r) { ... 阅读全文
posted @ 2018-01-20 15:20 WenOI 阅读(126) 评论(0) 推荐(0) 编辑
水波背景