ACM---重刷kuangbin
文章平均质量分 88
AI蜗牛之家
北航烟酒僧~ 百度、腾讯自然语言处理算法工程师~
展开
-
[kuangbin带你飞]专题一 简单搜索
POJ 3279 (暴力搜索)首先根据题目,每次操作都会影响到周围的“棋子”,而要使得每个1都被反转为0,那么我们就应当每次都反转1下方的棋子以改变1为0.那么,当我们处理过1到n-1行的时候,前n-1行就都已经是0了,最后我们只需要检查最后一行是不是全部为0就可以检查这次的出操作是否正确了。如果正确且最小,那就存起来。最后输出,万事大吉。当然,因为我们要改变第x行的1为0需要原创 2017-04-12 18:03:05 · 613 阅读 · 0 评论 -
HDU - 1087 Super Jumping! Jumping! Jumping! (DP)
E - Super Jumping! Jumping! Jumping! Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this gam原创 2017-04-17 13:56:48 · 773 阅读 · 0 评论 -
hdu1074Doing Homework( 状态压缩dp)
D - Doing Homework HDU - 1074 Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework.原创 2017-04-17 11:10:38 · 855 阅读 · 0 评论 -
POJ 3356 AGTC(DP)
谁说蓝桥杯很水,这道题目还是和可以的,刷题的时候忽然想起来这道题,现在写成博客!!脱氧核糖核酸即常说的DNA,是一类带有遗传信息的生物大分子。它由4种主要的脱氧核苷酸(dAMP、dGMP、dCMT和dTMP)通过磷酸二酯键连接而成。这4种核苷酸可以分别记为:A、G、C、T。 DNA携带的遗传信息可以用形如:AGGTCGACTCCA.... 的串来表示。DNA在转录复制的过原创 2017-04-16 16:08:31 · 861 阅读 · 0 评论 -
非常可乐(搜索)
非常可乐Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 1495Description大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,原创 2016-05-06 21:48:10 · 1638 阅读 · 0 评论 -
Pots(BFS)
PotsTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 3414DescriptionYou are given two pots, having the volume of A and B l原创 2016-05-07 10:13:13 · 1487 阅读 · 0 评论 -
HDU 1024 Max Sum Plus Plus(DP+滚动数组)
A - Max Sum Plus PlusTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 1024DescriptionNow I think you have got an AC in Ignatiu原创 2016-05-05 09:48:10 · 972 阅读 · 0 评论 -
poj 3186 Treats for the Cows(滚动DP OR 记忆化搜索)
O - Treats for the Cows POJ - 3186 FJ has purchased N (1 The treats are interesting for many reasons:The treats are numbered 1..N and stored sequentially in single file in a long b原创 2017-04-18 21:24:24 · 830 阅读 · 0 评论 -
HDU 2859 Phalanx (DP)
Today is army day, but the servicemen are busy with the phalanx for the celebration of the 60th anniversary of the PRC. A phalanx is a matrix of size n*n, each element is a character (a~z or A~Z), s原创 2017-04-19 10:20:55 · 783 阅读 · 0 评论 -
POJ 3616 Milking Time (DP)
Bessie is such a hard-working cow. In fact, she is so focused on maximizing her productivity that she decides to schedule her next N (1 ≤ N ≤ 1,000,000) hours (conveniently labeled 0..N-1) so that she原创 2017-04-19 10:50:20 · 835 阅读 · 0 评论 -
HDU 4507 吉哥系列故事――恨7不成妻 (平方拆解 + *数位DP 总结)
单身! 依然单身! 吉哥依然单身! DS级码农吉哥依然单身! 所以,他生平最恨情人节,不管是214还是77,他都讨厌! 吉哥观察了214和77这两个数,发现: 2+1+4=7 7+7=7*2 77=7*11 最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚至讨厌一切和7有关的数! 什么样的数和7有关呢? 如果一个整原创 2017-04-28 17:01:59 · 886 阅读 · 0 评论 -
SPOJ - BALNUM Balanced Numbers (*数位DP+三进制拆分)
Balanced numbers have been used by mathematicians for centuries. A positive integer is considered a balanced number if:1) Every even digit appears an odd number of times in its decimal represen原创 2017-04-30 19:50:19 · 1314 阅读 · 0 评论 -
[kuangbin带你飞]专题十二 基础DP1
IDOriginTitle题解连接 167 / 465Problem AHDU 1024Max Sum Plus Plushere 234 / 372Problem BHDU 1029Ignatius and原创 2017-04-15 15:56:41 · 967 阅读 · 0 评论 -
POJ 2955 Brackets (DP Or 记忆化搜索 总结)
POJ - 2955 Brackets We give the following inductive definition of a “regular brackets” sequence:the empty sequence is a regular brackets sequence,if s is a regular brackets sequence, then原创 2017-04-20 20:43:51 · 845 阅读 · 0 评论 -
LightOJ 1422 Halloween Costumes (区间DP OR 记忆化搜索 方法总结)
题意:现在那个人要去参加一个聚会,然后总共有n天,每天所要求穿的服饰的序号分别为c[i]。这个人可以一次性穿上1件衣服,或者一次性脱下任意多件衣服。当然也可以在衣服外面套衣服。并且如果这件衣服已经被脱下的话,那么它下次不能再次被穿上,如果我们还需要这件衣服的话,那么我们就只能重新再去买另外一件了。最后问你,如果要参加完所有的派对,那么他所需要的最少的衣服数量是多少。原创 2017-04-20 18:51:22 · 893 阅读 · 0 评论 -
codeforces 149D Coloring Brackets (区间DP OR 记忆化搜索 总结!!!)
D - Coloring Brackets CodeForces - 149D 题目描述: 给一个合法的括号串,然后问这串括号有多少种涂色方案,当然啦!涂色是有限制的。 1,每个括号只有三种选择:涂红色,涂蓝色,不涂色。 2,每对括号有且仅有其中一个被涂色。 3,相邻的括号不能涂相同的颜色,但是相邻的括号可以同时不涂色。原创 2017-04-21 17:28:07 · 861 阅读 · 0 评论 -
HDU 1078 FatMouse and Cheese(记忆化搜索 Or DP)
P - FatMouse and Cheese HDU - 1078FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <=原创 2017-04-18 22:21:39 · 841 阅读 · 0 评论 -
HDU - 1176 免费馅饼(逆向DP Or 记忆化搜索)
G - 免费馅饼 HDU - 1176 都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩原创 2017-04-17 18:24:01 · 2728 阅读 · 4 评论 -
HDU 1260 Tickets(DP OR 记忆化搜索)
H - Ticketsesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets. He is wandering when could he原创 2017-04-17 20:10:08 · 907 阅读 · 0 评论 -
ZOJ 3494 BCD Code (*AC自动机+数位DP 待整理)
Binary-coded decimal (BCD) is an encoding for decimal numbers in which each digit is represented by its own binary sequence. To encode a decimal number using the common BCD encoding, each decimal digi原创 2017-04-28 11:58:32 · 864 阅读 · 0 评论 -
HDU 4734 F(x)(数位DP)
For a decimal number x with n digits (A nA n-1A n-2 ... A 2A 1), we define its weight as F(x) = A n * 2 n-1 + A n-1 * 2 n-2 + ... + A 2 * 2 + A 1 * 1. Now you are given two numbers A and B, please c原创 2017-04-28 11:13:03 · 774 阅读 · 0 评论 -
POJ 3252 Round Numbers (组合数学)
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', 'Ro, Sham, Bo', and a host of other names) in order to make原创 2017-04-27 22:04:19 · 926 阅读 · 0 评论 -
HDU 3555 Bomb (数位DP)
The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the current number sequence inc原创 2017-04-27 21:30:39 · 912 阅读 · 0 评论 -
HDU 2089 不要62(数位DP)
不要62 HDU - 2089 杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。 不吉利的数字为所有含有4或62的号码。例如: 62315 73418 88914 都属于不吉利号码。但是,原创 2017-04-27 19:54:36 · 734 阅读 · 0 评论 -
CodeForces - 55D Beautiful numbers(*数位DP 取余 LCM 总结)
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 each of its nonzero digits. We will not argue with原创 2017-04-27 15:47:25 · 853 阅读 · 0 评论 -
HDU 4352 XHXJ's LIS(*数位DP 记忆化搜索 待整理)
XHXJ's LIS HDU - 4352 #define xhxj (Xin Hang senior sister(学姐)) If you do not know xhxj, then carefully reading the entire description is very important. As the strongest fighting forc原创 2017-04-27 12:23:33 · 959 阅读 · 0 评论 -
HDU 2476 String painter (*区间DP+基础Dp)
H - String painter HDU - 2476 There are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help of th原创 2017-04-26 16:31:32 · 868 阅读 · 0 评论 -
HDU - 4283 You Are the One(记忆化搜索 * DP)
You Are the One HDU - 4283 题意:有n个男屌丝事先按1,2,3,,,,,,n的顺序排好,每个人都有一个不开心值unhappy[i],如果第i个人第k个上台找对象,那么该屌丝男的不开心值就会为(k-1)*unhappy[i],因为在他前面有k-1个人嘛,导演为了让所有男屌的总不开心值最小,搞了一个小黑屋,可以通原创 2017-04-26 12:12:50 · 732 阅读 · 0 评论 -
ZOJ 3469 Food Delivery(* 区间DP 总结)
F - Food Delivery ZOJ - 3469 题意:有一家快餐店送外卖,现在同时有n个家庭打进电话订购,送货员得以V-1的速度一家一家的运送,但是每一个家庭都有一个不开心的值,每分钟都会增加一倍,值达到一定程度,该家庭将不会再订购外卖了,现在为了以后有更多的家庭订购,要将外卖送到的情况下使得原创 2017-04-26 11:01:52 · 830 阅读 · 0 评论 -
zoj 3965 Binary Tree Restoring(* dfs)
Binary Tree RestoringTime Limit: 1 Second Memory Limit: 65536 KB Special JudgeGiven two depth-first-search (DFS) sequences of a binary tree, can you find a binary tree which satisf原创 2017-04-25 21:47:59 · 1414 阅读 · 0 评论 -
ZOJ 3962 Seven Segment Display(*数位DP 总结)
Seven Segment DisplayA seven segment display, or seven segment indicator, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot matr原创 2017-04-23 17:09:16 · 1019 阅读 · 0 评论 -
POJ 1651 Multiplication Puzzle (区间DP OR 记忆化搜索)
E - Multiplication Puzzle POJ - 1651 (1)分析最优子结构 在这个问题中想得到a b c d e f之间最小值,比如开始拿d位置的,那么问题就转化成了a b c e和c e f这两个子问题的最小值再加上c*d*e就行了,不过如果真的是这么想的话,也就是把d当成最开始拿的话,怎么表示?开始还想用dp[i][j][k]表示区间i~j之间去掉原创 2017-04-21 20:39:39 · 725 阅读 · 0 评论 -
HDU 3652 B-number(*数位DP)
G - B-number HDU - 3652 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, 130 and 2613原创 2017-04-28 10:14:34 · 902 阅读 · 0 评论 -
POJ 1458 Common Subsequence(LCS)
Common Subsequence A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if t原创 2017-04-18 10:01:49 · 739 阅读 · 0 评论 -
hdu 1160 FatMouse's Speed ( LIS )
FatMouse's Speed FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data原创 2017-04-17 21:48:16 · 748 阅读 · 0 评论 -
POJ 1661Help Jimmy(逆向DP Or 记忆化搜索 Or 最短路径)
Help Jimmy"Help Jimmy" 是在下图所示的场景上完成的游戏。 场景中包括多个长度和高度各不相同的平台。地面是最低的平台,高度为零,长度无限。 Jimmy老鼠在时刻0从高于所有平台的某处开始下落,它的下落速度始终为1米/秒。当Jimmy落到某个平台上时,游戏者选择让它向左还是向右跑,它跑动的速度也是1米/秒。当Jimmy跑到平台的边缘时,开始继续原创 2017-04-18 18:25:49 · 1257 阅读 · 0 评论