Scientific Conference
之前一直在刷计算几何,邀请赛连计算几何的毛都买见着,暑假这一段时间就做多校,补多校的题目,刷一下一直薄弱的DP。
题意:给你N个报告会的开始时间跟结束时间,问你做多可以听几场报告会。要求报告会之间至少间隔为1。
思路:其实是个活动安排问题,可以用贪心也可以用DP,贪心写起来会比较简单一些,因为练习DP...
分类:
其他好文 时间:
2014-07-23 20:57:15
阅读次数:
161
Maximum Sum
大意:给你一个n*n的矩阵,求最大的子矩阵的和是多少。
思路:最开始我想的是预处理矩阵,遍历子矩阵的端点,发现复杂度是O(n^4),就不知道该怎么办了。问了一下,是压缩矩阵,转换成最大字段和的问题。
压缩行或者列都是可以的。
int n, m, x, y, T, t;
int Map[1010][1010];
int m...
分类:
其他好文 时间:
2014-07-23 20:54:55
阅读次数:
324
Balance
Time Limit: 1000MS
Memory Limit: 30000K
Total Submissions: 10326
Accepted: 6393
题意:给你n个挂钩g个砝码 以及n个挂钩的距离天平中心距离(负的代表左边正的代表右边)g个砝码的重量。
要求输出可以令天平平衡的方法种类
解题思路 ...
分类:
其他好文 时间:
2014-07-23 18:10:10
阅读次数:
194
题目大意:
要找出1到n之间有多少个数含13,并且能被13整除
记忆化搜索:
dp[pos][pre][mod][statu],pos位数,pre前一位,mod余数,statu状态
有2个状态:含13,不含13
#include
#include
#include
#include
#include
#include
#include
#include
#include
#inc...
分类:
其他好文 时间:
2014-07-23 18:08:05
阅读次数:
193
题目:hdoj1561The more, The Better
题意:ACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽量多的宝物应该攻克哪M个城堡吗?
分析:
分类:树形d...
分类:
其他好文 时间:
2014-07-23 18:05:26
阅读次数:
227
那么一大篇的题目描述还真是吓人。仔细一读其实就是一个LIS,还无任何变形。刚刚学会了个二分优化的DP,1A无压力。 1 //#define LOCAL 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int ...
分类:
其他好文 时间:
2014-07-23 18:00:44
阅读次数:
180
题目来源:吉哥系列故事——完美队形II
题意:中文
思路:在manacher算法向两边扩展的时候加判断 保证非严格递减就行了
#include
#include
#include
using namespace std;
const int maxn = 100110;
int a[maxn<<1];
int b[maxn<<1];
int dp[maxn<<1];
int manac...
分类:
其他好文 时间:
2014-07-23 17:18:54
阅读次数:
381
题意比较麻烦。。。n天,给出每天的叶子的一种状态(Dry , Dryish , Damp and Soggy),最有可能出现的天气序列(Sunny, Cloudy and Rainy)
最开始,第一天处于每种状态有一个预定义的概率。每一天,根据当前的叶子状态,处于每种天气状况有一个给定的概率;题目中还给出任意两种天气状态的转移概率,即前一天处于某种天气时今天处于某种天气的概率。...
分类:
其他好文 时间:
2014-07-23 17:14:40
阅读次数:
157
Problem A: Tower of Cubes
In this problem you are given N colorful cubes each having a distinct weight. Each face of a cube is colored with one color. Your job is to build a tower using th...
分类:
其他好文 时间:
2014-07-23 17:07:51
阅读次数:
251
A message containing letters from A-Z is being encoded to numbers using the following mapping:
'A' -> 1
'B' -> 2
...
'Z' -> 26
Given an encoded message containing digits, determine the total numb...
分类:
其他好文 时间:
2014-07-23 17:06:05
阅读次数:
324