关闭

Contestant Division(树形dp)

In the new ACM-ICPC Regional Contest, a special monitoring and submitting system will be set up, and students will be able to compete at their own universities. However there’s one problem. Due to the...
阅读(7) 评论(0)

God Father (树形dp 树的重心)

Last years Chicago was full of gangster fights and strange murders. The chief of the police got really tired of all these crimes, and decided to arrest the mafia leaders.Unfortunately, the structure of...
阅读(8) 评论(0)

Anniversary Party(树形dp)

Anniversary party Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8765 Accepted: 5031 DescriptionThere is going to be a party to celebrate the 80-th Anniversary of the Ural State...
阅读(8) 评论(0)

Tree Cutting 树形dp

After Farmer John realized that Bessie had installed a “tree-shaped” network among his N (1 <= N <= 10,000) barns at an incredible cost, he sued Bessie to mitigate his losses. Bessie, feeling vindictiv...
阅读(8) 评论(0)

POJ 3613 Cow Relays k步最短路 (floyd + 矩阵快速幂)

Cow Relays Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7738 Accepted: 3033 DescriptionFor their physical fitness program, N (2 ≤ N ≤ 1,000,000) cows have decided to run a rel...
阅读(15) 评论(0)

POJ 3186 Treat for the Cows(区间dp)

Treats for the Cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6163 Accepted: 3208 DescriptionFJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for...
阅读(16) 评论(0)

POJ 1745 Divisiblity

Divisibility Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 12386 Accepted: 4421 DescriptionConsider an arbitrary sequence of integers. One can place + or - operators between...
阅读(14) 评论(0)

次小生成树模板(坑惨了)

In order to prepare the “The First National ACM School Contest” (in 20??) the major of the city decided to provide all the schools with a reliable source of power. (The major is really afraid of blac...
阅读(14) 评论(0)

HDU 1260 Tickets(DP)

TicketsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4513 Accepted Submission(s): 2320Problem Description Jesus, what a great movie! Thou...
阅读(21) 评论(0)

背包输出路径

#include #include #include #include #include #define maxn 1010 using namespace std; typedef long long ll; ll v[maxn]; ll w[maxn]; int n,p; ll dp[maxn]; int pre[maxn]; int main() { int t;...
阅读(26) 评论(0)

Bottles(选择k个物品的01背包)

Nick has n bottles of soda left after his birthday. Each bottle is described by two values: remaining amount of soda ai and bottle volume bi (ai ≤ bi).Nick has decided to pour all remaining soda into m...
阅读(25) 评论(0)

FATE (完全背包)

最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只杀s只怪。请问他能升掉这最后一级吗? Inpu...
阅读(13) 评论(0)

Coins (多重背包)

Whuacmers use coins.They have coins of value A1,A2,A3…An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a nearby shop. He wanted t...
阅读(19) 评论(0)

HDU1864 最大报销费用(01背包)

现有一笔经费可以报销一定额度的发票。允许报销的发票类型包括买图书(A类)、文具(B类)、差旅(C类),要求每张发票的总额不得超过1000元,每张发票上,单项物品的价值不得超过600元。现请你编写程序,在给出的一堆发票中找出可以报销的、不超过给定额度的最大报销额。 Input 测试输入包含若干测试用例。每个测试用例的第1行包含两个正数 Q 和 N,其中 Q 是给定的报销额度,N(<=30)是发票...
阅读(16) 评论(0)

Robberies(DP之01背包)

The aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has decided to work in the lucrative...
阅读(22) 评论(0)

HDU 1176 免费馅饼 (DP)

免费馅饼Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 50035 Accepted Submission(s): 17341Problem Description 都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽...
阅读(54) 评论(0)

poj 1458 LCS(最长公共子序列)

Common Subsequence Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 53343 Accepted: 22124 DescriptionA subsequence of a given sequence is the given sequence with some elements...
阅读(19) 评论(0)

Sonya and A Problem without A Legend(DP+优化)

Sonya was unable to think of a story for this problem, so here comes the formal description.You are given the array containing n positive integers. At one turn you can pick any element and increase or...
阅读(18) 评论(0)

Boredom (DP)

Alex doesn’t like boredom. That’s why whenever he gets bored, he comes up with games. One long winter evening he came up with a game and decided to play it.Given a sequence a consisting of n integers....
阅读(16) 评论(0)

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 N distinct bill denominations, say Dk, k=...
阅读(29) 评论(0)
65条 共4页1 2 3 4 下一页 尾页
    个人资料
    • 访问:1430次
    • 积分:652
    • 等级:
    • 排名:千里之外
    • 原创:64篇
    • 转载:0篇
    • 译文:1篇
    • 评论:0条
    文章存档