海绵的博客

竞赛虐我千百遍,我待竞赛如初恋。 Never Give Up!!!

Partial Tree HDU - 5534 (完全背包,初始化)

In mathematics, and more specifically in graph theory, a tree is an undirected graph in which any two nodes are connected by exactly one path. In oth...

2018-10-01 21:28:56

阅读数:64

评论数:0

Counting 4-Cliques

链接:https://www.nowcoder.com/acm/contest/145/E 来源:牛客网   题目描述 You love doing graph theory problems. You've recently stumbled upon a classical problem...

2018-08-10 21:37:45

阅读数:22

评论数:0

Ingenuous Cubrency UVA - 11137(完全背包)

#include<bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,a,b) for(int i=a;i<b;i++) con...

2018-08-07 19:27:18

阅读数:18

评论数:0

PACM Team (01背包,卡空间)

链接:https://www.nowcoder.com/acm/contest/141/A 来源:牛客网   Eddy was a contestant participating in ACM ICPC contests. ACM is short for Algorithm, Coding,...

2018-07-26 18:25:29

阅读数:40

评论数:0

Sum of Different Primes UVA - 1213 (01背包计数)

#include<bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,a,b) for(int i=a;i<b;i++) #de...

2018-07-25 18:53:06

阅读数:26

评论数:0

C - Knapsack problem FZU - 2214

Given a set of n items, each with a weight w[i] and a value v[i], determine a way to choose the items into a knapsack so that the total weight is le...

2018-04-18 18:15:17

阅读数:19

评论数:0

历届试题 包子凑数(拓展欧几里得+ 完全背包)

问题描述   小明几乎每天早晨都会在一家包子铺吃早餐。他发现这家包子铺有N种蒸笼,其中第i种蒸笼恰好能放Ai个包子。每种蒸笼都有非常多笼,可以认为是无限笼。   每当有顾客想买X个包子,卖包子的大叔就会迅速选出若干笼包子来,使得这若干笼中恰好一共有X个包子。比如一共有3种蒸笼,分别能放3、4和5...

2018-03-08 09:24:31

阅读数:51

评论数:0

动态规划之01背包,完全背包,多重背包

01背包01背包问题,是用来介绍动态规划算法最经典的例子。01背包的转换方程 f[i][j] = Max{ f[i-1][j-Wi]+Pi( j >= Wi ),  f[i-1][ j ] }f[i,j]表示在前i件物品中选择若干件放在承重为 j 的背包中,可以取得的最大价值...

2017-08-14 11:37:45

阅读数:310

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭