码迷,mamicode.com
首页 >  
搜索关键字:crb and candies    ( 410个结果
POJ 2886 Who Gets the Most Candies? (线段树)
【题目链接】 http://poj.org/problem?id=2886 【题目大意】 一些人站成一个圈,每个人手上都有一个数字, 指定从一个人开始淘汰,每次一个人淘汰时,将手心里写着的数字x展示 如果x是正数,则淘汰右手边第x个人,否则淘汰左手边地-x个人。 每个人淘汰的时候将获得积分,积分的多 ...
分类:其他好文   时间:2017-01-21 16:00:56    阅读次数:206
LeetCode 135 Candy(贪心算法)
135. Candy 135. Candy There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subject ...
分类:编程语言   时间:2017-01-03 20:31:53    阅读次数:276
HDU 5410 CRB and His Birthday ——(完全背包变形)
对于每个物品,如果购买,价值为A[i]*x+B[i]的背包问题。 先写了一发是WA的= =。代码如下: 正解是,先跑一遍价值为A[i]+B[i]的01背包,再跑一遍价值为A[i]完全背包。所以上面的代码错了大概是因为,这两个背包的第二个for的方向是不同的,没办法一起跑吧(除非用另外一组变量记录下到 ...
分类:其他好文   时间:2016-12-16 21:58:02    阅读次数:171
leetcode 135. Candy ----- java
There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following re ...
分类:编程语言   时间:2016-11-14 17:43:28    阅读次数:231
HDU 5795 A Simple Nim 打表求SG函数的规律
A Simple Nim Problem Description Two players take turns picking candies from n heaps,the player who picks the last one will win the game.On each turn ...
分类:其他好文   时间:2016-10-29 19:35:39    阅读次数:312
135. Candy
There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following re ...
分类:其他好文   时间:2016-10-14 07:35:00    阅读次数:111
UVA10118 Free Candies
题解: 记忆化搜索 如何判断一个数是否已经出现?应用位运算即可.... 代码: ...
分类:其他好文   时间:2016-10-11 21:48:52    阅读次数:119
poj3159 Candies(差分约束,dij+heap)
poj3159 Candies 这题实质为裸的差分约束。 先看最短路模型:若d[v] >= d[u] + w, 则连边u->v,之后就变成了d[v] <= d[u] + w , 即d[v] – d[u] <= w。 再看题目给出的关系:b比a多的糖果数目不超过c个,即d[b] – d[a] <= c ...
分类:其他好文   时间:2016-09-14 21:53:59    阅读次数:120
2015暑假多校联合---CRB and His Birthday(01背包)
题目链接 http://acm.split.hdu.edu.cn/showproblem.php?pid=5410 Problem Description Today is CRB's birthday. His mom decided to buy many presents for her lo ...
分类:其他好文   时间:2016-09-02 21:57:51    阅读次数:193
Candy
There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following re ...
分类:其他好文   时间:2016-09-01 20:07:03    阅读次数:157
410条   上一页 1 ... 15 16 17 18 19 ... 41 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!