
基本dp
rainbowsea_1
难得有了目标,怎么可以还是烂人一条!
展开
-
Zero Remainder Sum
Zero Remainder Sum链接题意给出n行,每行有m个,每行可选小于等于m/2个,使得和是k的倍数,且和最大题解开4维dp,第i行的第j列,拿的个数cnt,余数res_k//注意边界#include <algorithm>#include <iostream>#include <cstdio>#include <cmath>#include <iomanip>#include <cstring>#in原创 2020-12-02 23:24:56 · 180 阅读 · 0 评论 -
有关计数问题的dp
n个无区别物体,分为不超过m组将n划分m组,每组ai个,表示为:即a1 + a2 + a3 +…+ am = n;如果对于每个i都有ai >0,那么{ai - 1} 就对应n-m 划分 m 组,即(a1 - 1) +( a2 - 1) +( a3 - 1)+…+( am - 1) = n - m;如果存在ai = 0, 就对应n 划分 m - 1 组。dp[ i ][ j ] ...原创 2020-02-27 09:53:27 · 325 阅读 · 0 评论 -
POJ - 1106 Transmitters
TransmittersIn a wireless network with multiple transmitters sending on the same frequencies, it is often a requirement that signals don’t overlap, or at least that they don’t conflict. One way of ac...原创 2020-03-01 23:08:45 · 258 阅读 · 0 评论 -
poj 1742
CoinsSilverland的人使用硬币。他们有A1,A2,A3的硬币…一个Silverland美元。一天,Tony打开他的存钱罐,发现里面有一些硬币。他决定在附近的商店里买一块非常漂亮的手表。他想付确切的价格(没有零钱),他知道价格不会超过m。但是他不知道手表的确切价格。您将要编写一个程序,该程序读取n,m,A1,A2,A3 … An和C1,C2,C3 … Cn对应于托尼硬币的值A1,A...原创 2020-02-27 09:15:19 · 604 阅读 · 0 评论 -
poj3046 Ant Counting
蚂蚁计数描述贝西有一天在蚂蚁山上戳戳,看着蚂蚁在收集食物时来回走动。她意识到许多蚂蚁是兄弟姐妹,彼此之间没有区别。她还意识到,有时只有一只蚂蚁会去觅食,有时是几只,有时都是。这使得大量不同的蚂蚁!由于有点数学,贝西开始思考。贝西(Bessie)指出,该配置单元具有T(1 <= T <= 1,000)个蚂蚁家族,她将它们标记为1…T(一共一个蚂蚁)。每个家庭都有一定数量的...原创 2020-02-27 08:58:29 · 202 阅读 · 0 评论 -
poj3616 Milking Time
DescriptionBessie 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) s...原创 2020-02-24 20:44:59 · 156 阅读 · 0 评论 -
poj1276 Cash Machine(多重背包)
A Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly Ndistinct bill denominations, say Dk, k...原创 2020-02-24 20:21:14 · 277 阅读 · 0 评论