ZOJ 3872 Beauty of Array(数学啊)...
分类:
其他好文 时间:
2015-04-28 22:49:36
阅读次数:
237
题目传送门 1 /* 2 DP:dp 表示当前输入的x前的包含x的子序列的和, 3 求和方法是找到之前出现x的位置(a[x])的区间内的子序列; 4 sum 表示当前输入x前的所有和; 5 a[x] 表示id; 6 详细解释:http:...
分类:
其他好文 时间:
2015-04-26 13:39:49
阅读次数:
140
Beauty of Array
Time Limit: 2 Seconds
Memory Limit: 65536 KB
Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the a...
分类:
其他好文 时间:
2015-04-26 09:21:18
阅读次数:
156
Beauty of Array
Time Limit: 2 Seconds
Memory Limit: 65536 KB
Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the arr...
分类:
其他好文 时间:
2015-04-25 21:14:48
阅读次数:
220
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define LL long long
#define INF 0x7fffffff
using namespace std;
long long int d...
分类:
其他好文 时间:
2015-04-25 19:53:31
阅读次数:
145
Beauty Is in SimplicityTHERE iS ONE qUOTE, from Plato, that I think is particularly good for all software developers to know and keep close to their hearts:
Beauty of style and harmony and grace and g...
分类:
其他好文 时间:
2015-04-18 16:15:05
阅读次数:
137
Little penguin Polo likes permutations. But most of all he likes permutations of integers from 0 to n, inclusive.For permutation p?=?p0,?p1,?…,?pn, Polo has defined its beauty — number .Expression mean...
分类:
其他好文 时间:
2015-04-08 18:08:05
阅读次数:
144
poj2187 求平面最远点对,garham_scan算法求凸包Beauty ContestTime Limit:3000MSMemory Limit:65536KTotal Submissions:29666Accepted:9180DescriptionBessie, Farmer John's...
分类:
编程语言 时间:
2015-04-07 00:26:26
阅读次数:
317
URAL 1501. Sense of Beauty(记忆化搜索 dfs)...
分类:
其他好文 时间:
2015-03-28 11:41:10
阅读次数:
180
给你两堆牌,牌的颜色只有红色或者黑色。 然后从两堆牌的牌顶来抽牌,每次抽可以选择两堆中的一堆。每次抽完,所得到的牌,红牌和黑牌数量相差必须不超过1。
做法:
因为一共各1000张牌,所以可以dp记忆化搜索。dp[i][j]代表 在第一堆牌抽了i张,第二堆牌抽了j张的情况下, 有没有不违反规则 达到这状态的方法。如果有 dp[i][j]会等于0,1,2,0表示当前多了一个黑牌,1表示当前红黑牌一样多,2表示当前红牌多一张。-2表示没达到这种状态的方法。
然后就是几种转移的方法,都要在dfs(i-1,j)或...
分类:
其他好文 时间:
2015-03-28 10:14:54
阅读次数:
218