随笔分类 -  dp

摘要:B. The least round way time limit per test 2 seconds memory limit per test 64 megabytes input standard input output standard output B. The least round 阅读全文
posted @ 2019-04-10 21:49 WAKBGAN 阅读(220) 评论(0) 推荐(0)
摘要:Description A Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The 阅读全文
posted @ 2019-04-10 18:46 WAKBGAN 阅读(186) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/553/C来源:牛客网 题目描述 Chino的数学很差,因此Cocoa非常担心。今天,Cocoa准备教Chino和排队有关的问题。 我们总是会学各种排列组合的问题,那些题目大多数都是套路。而Cocoa不喜欢套路。 通常来说 阅读全文
posted @ 2019-04-06 23:12 WAKBGAN 阅读(393) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/554/G Now we have a function f(x): int f ( int x ) { if ( x == 0 ) return 0; return f ( x / 10 ) + x % 10; } Fo 阅读全文
posted @ 2019-04-03 20:10 WAKBGAN 阅读(408) 评论(0) 推荐(0)
摘要:Description The cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors 阅读全文
posted @ 2019-04-03 00:16 WAKBGAN 阅读(208) 评论(0) 推荐(0)
摘要:A wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string "13" and can be divided by 13. For example, 阅读全文
posted @ 2019-04-02 22:50 WAKBGAN 阅读(172) 评论(0) 推荐(0)
摘要:Description A straight dirt road connects two fields on FJ's farm, but it changes elevation more than FJ would like. His cows do not mind climbing up 阅读全文
posted @ 2019-04-02 19:43 WAKBGAN 阅读(173) 评论(0) 推荐(0)
摘要:Description FJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving vast amounts of milk. FJ sells one treat per day an 阅读全文
posted @ 2019-04-02 14:58 WAKBGAN 阅读(160) 评论(0) 推荐(0)
摘要:Description "Help Jimmy" 是在下图所示的场景上完成的游戏。 场景中包括多个长度和高度各不相同的平台。地面是最低的平台,高度为零,长度无限。 Jimmy老鼠在时刻0从高于所有平台的某处开始下落,它的下落速度始终为1米/秒。当Jimmy落到某个平台上时,游戏者选择让它向左还是向右 阅读全文
posted @ 2019-04-02 00:43 WAKBGAN 阅读(201) 评论(0) 推荐(0)
摘要:In Frobnia, a far-away country, the verdicts in court trials are determined by a jury consisting of members of the general public. Every time a trial 阅读全文
posted @ 2019-03-31 21:19 WAKBGAN 阅读(256) 评论(0) 推荐(0)
摘要:问题描述 给定一个长度为N的数列,A1, A2, ... AN,如果其中一段连续的子序列Ai, Ai+1, ... Aj(i <= j)之和是K的倍数,我们就称这个区间[i, j]是K倍区间。 你能求出数列中总共有多少个K倍区间吗? 输入格式 第一行包含两个整数N和K。(1 <= N, K <= 1 阅读全文
posted @ 2019-03-23 10:48 WAKBGAN 阅读(272) 评论(0) 推荐(0)
摘要:x星球的居民脾气不太好,但好在他们生气的时候唯一的异常举动是:摔手机。各大厂商也就纷纷推出各种耐摔型手机。x星球的质监局规定了手机必须经过耐摔测试,并且评定出一个耐摔指数来,之后才允许上市流通。x星球有很多高耸入云的高塔,刚好可以用来做耐摔测试。塔的每一层高度都是一样的,与地球上稍有不同的是,他们的 阅读全文
posted @ 2019-03-16 14:43 WAKBGAN 阅读(1119) 评论(0) 推荐(0)
摘要:Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by 阅读全文
posted @ 2019-02-27 16:38 WAKBGAN 阅读(238) 评论(0) 推荐(0)
摘要:Problem Description 杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如 阅读全文
posted @ 2019-02-26 21:20 WAKBGAN 阅读(148) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/371/B来源:牛客网 小睿睿的n个妹纸排成一排,每个妹纸有一个颜值val[i]。有m个询问,对于每一个询问,小睿睿想知道区间[L,R]颜值最高而编号最小的妹纸是哪一个 对于妹纸们的颜值val[i],其生成函数为: voi 阅读全文
posted @ 2019-02-23 00:10 WAKBGAN 阅读(248) 评论(0) 推荐(0)
摘要:Problem Description The company "21st Century Fruits" has specialized in creating new sorts of fruits by transferring genes from one fruit into the ge 阅读全文
posted @ 2019-02-18 16:27 WAKBGAN 阅读(197) 评论(0) 推荐(0)
摘要:Problem Description Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more diffi 阅读全文
posted @ 2019-02-18 15:21 WAKBGAN 阅读(195) 评论(0) 推荐(0)
摘要:Problem Description 急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变 阅读全文
posted @ 2019-02-18 14:58 WAKBGAN 阅读(133) 评论(0) 推荐(0)
摘要:这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下:1.机器人一开始在棋盘的起始点并有起始点所标有的能量。2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。3.机器人不能在原地停留。4.当机器人选择了一条可行路径后,当他走到这条路 阅读全文
posted @ 2019-02-17 23:20 WAKBGAN 阅读(174) 评论(0) 推荐(0)
摘要:Problem Description 搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累, 阅读全文
posted @ 2019-02-17 19:30 WAKBGAN 阅读(137) 评论(0) 推荐(0)