- 博客(40)
- 收藏
- 关注
原创 java编程技术 期末考试复习
1.类名前面可加public也可不加,加了保存的文件名必须为类名。2.由1可知,一个文件里面最多只能有一个(最外层)类是public,否则文件名是什么呢?3.package fuxi1;public class Main { public class test { }public static void main(String args[])
2015-12-31 23:11:14 2608
原创 hdu 1011 Starship Troopers 树形背包 !!!原因不明wa?★★★☆
Starship TroopersTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15164 Accepted Submission(s): 4076Problem DescriptionYou, t
2015-12-31 12:52:53 415
原创 poj 1155 TELE 基础题,树形背包
有一个电视台要用电视网络转播节目。这种电视网络是一树,树的节点为中转站或者用户。树节点的编号为1~N,其中1为总站,2~(N-M)为中转站,(总站和中转站统称为转发站)N-M+1~N为用户,电视节目从一个地方传到另一个地方都要费用,同时每一个用户愿意出相应的钱来付电视节目。现在的问题是,在电视台不亏本的前提下,要你求最多允许有多少个用户可以看到电视节目。
2015-12-30 20:29:53 428
原创 poj 2152 Fire 树形DP ★★★★
FireTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 1354 Accepted: 714DescriptionCountry Z has N cities, which are numbered from 1 to N. Cities are co
2015-12-30 13:10:05 419
原创 排序方法巩固(基础知识)
1.hdu 1106 快速排序排序Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 45439 Accepted Submission(s): 13031Problem Description
2015-12-29 15:50:23 569
原创 poj 1741 Tree 树形DP + 树分治 ★★★★
TreeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 15090 Accepted: 4913DescriptionGive a tree with n vertices,each edge has a length(positive integer
2015-12-28 22:35:46 356
原创 hdu 4336 Card Collector 概率DP 求期望
Card CollectorTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3538 Accepted Submission(s): 1739Special JudgeProblem Description
2015-12-24 11:09:29 364
原创 hdu 2196 Computer 树形DP 求每个点的最远点距离 两次dfs的经典树形dp
ComputerTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4945 Accepted Submission(s): 2481Problem DescriptionA school bought t
2015-12-23 11:49:29 611
原创 hdu 1520 Anniversary party 基础树形DP 树的最大独立集
Anniversary partyTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7575 Accepted Submission(s): 3323Problem DescriptionThere is
2015-12-22 23:56:54 445
原创 ZOJ 3329 One Person Game 概率DP 求期望 待定系数法 ★
One Person GameTime Limit: 1 Second Memory Limit: 32768 KB Special JudgeThere is a very simple and interesting one-person game. You have 3 dice, namely Die1, Die2 and Die3. Die1 ha
2015-12-22 17:16:22 775
原创 hdu 4035 Maze 期望DP 待定系数法 ★★
MazeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 2192 Accepted Submission(s): 890Special JudgeProblem DescriptionWhen wake
2015-12-22 14:45:24 513
原创 zoj 3640 Help Me Escape 期望DP 简单题 适合记忆化搜索
因为终点不确定,而且范围灰常大,数组根本存不下所有状态,就算存下了,初始化也要浪费不少时间。所以必须记忆化搜索。#include#include#include#include#include#include#include#include#include#include#include#include#include#in
2015-12-19 21:04:21 403
原创 hdu 3853 LOOPS 期望dp 分母不能为0
给出一个n*m的迷宫,要求从(1,1)走到(n,m)点,求消耗魔法的期望。 对于任意一个位置,移动一次需要消耗两点魔法,有三种情况:移动到当前格,右移一格,下移一格,题目给出在每一个位置分别发生这三种情况的概率,保证和为1,且不会有越界的可能。
2015-12-19 12:15:38 382
原创 hdu 4405 Aeroplane chess 期望dp 基础题
飞机一开始在第0格,每次掷筛子,决定当前步前进多少格子。给出一些点对<x,y>(x<y),表示若飞机在x点停靠,则可立即到达点y,不浪费步数。问到达点n的步数期望。
2015-12-18 23:38:11 339
原创 poj 2096 Collecting Bugs 期望dp 简单题
Collecting BugsTime Limit: 10000MS Memory Limit: 64000KTotal Submissions: 3941 Accepted: 1964Case Time Limit: 2000MS Special JudgeDescriptionIvan is f
2015-12-18 21:19:58 261
原创 CF 148D Bag of mice 概率dp 简单题
一个袋子里有w个白老鼠和b个黑老鼠。龙和王妃轮流来取,每次抽取一只老鼠,王妃先取。规定先取到白色老鼠的获胜。如果老鼠全部取完还没有人取到白老鼠,那么龙获胜。龙每次去抽取老鼠时,如果袋子里还有其它老鼠,会随机跑出一只,而王妃在抽取时不会发生此种情况。给出w和b问王妃获胜的概率。
2015-12-17 17:45:13 453
原创 hdu 5200 Trees 排序+思维? ★★☆
TreesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1282 Accepted Submission(s): 398Problem DescriptionToday CodeFamer is go
2015-12-17 16:21:48 425
原创 poj 3211 Washing Clothes 分组背包?
Washing ClothesTime Limit: 1000MS Memory Limit: 131072KTotal Submissions: 9241 Accepted: 2956DescriptionDearboy was so busy recently that now he has piles of cl
2015-12-17 13:19:29 372
原创 poj 1837 Balance 分组背包
BalanceTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 12281 Accepted: 7704DescriptionGigel has a strange "balance" and he wants to poise it. Actually
2015-12-16 18:57:35 260
原创 hdu 1712 ACboy needs your help 分组背包
ACboy needs your helpTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5586 Accepted Submission(s): 3041Problem DescriptionACbo
2015-12-14 21:57:34 354
原创 poj 2392 Space Elevator 排序(贪心)+多重背包 仍然很水 ★★
Space ElevatorTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9955 Accepted: 4731DescriptionThe cows are going to space! They plan to achieve orbit by
2015-12-12 00:20:33 538
原创 poj 1276 Cash Machine 裸的多重背包 ★
Cash MachineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 30547 Accepted: 11005DescriptionA Bank plans to install a machine for cash withdrawal. The
2015-12-11 19:46:50 509
原创 ZOJ 3662 Math Magic 分阶段的动态规划 (+离散化) ★★★☆
Math MagicTime Limit: 3 Seconds Memory Limit: 32768 KBYesterday, my teacher taught us about math: +, -, *, /, GCD, LCM... As you know, LCM (Least common multiple) of two positive number
2015-12-11 16:52:56 473
原创 hdu 1059 Dividing 多重背包 超级水题 ★
DividingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 21390 Accepted Submission(s): 6028Problem DescriptionMarsha and Bill
2015-12-10 20:13:33 414
原创 zoj 3524 Crazy Shopping 拓扑排序+完全背包 ★★★☆
Crazy ShoppingTime Limit: 3 Seconds Memory Limit: 65536 KBBecause of the 90th anniversary of the Coherent & Cute Patchouli (C.C.P), Kawashiro Nitori decides to buy a lot of rare things to
2015-12-10 16:30:54 426
原创 hdu 1811 Rank of Tetris 拓扑排序+并查集 ★★★
Rank of TetrisTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7410 Accepted Submission(s): 2115Problem Description自从Lele开发了Ra
2015-12-10 16:20:33 373
原创 ZOJ 3623 Battle Ships 造战舰炸塔 动态规划 伪装较好的完全背包 ★★★
Battle ShipsTime Limit: 2 Seconds Memory Limit: 65536 KB Battle Ships is a new game which is similar to Star Craft. In this game, the enemy builds a defense tower, which hasL longev
2015-12-08 18:48:38 630
原创 hdu 1598 find the most comfortable road 枚举+并查集+贪心(类似最小生成树) ★★★
find the most comfortable roadTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5496 Accepted Submission(s): 2368Problem Descriptio
2015-12-08 13:46:54 266
原创 poj 1213 How Many Tables 并查集水题
How Many TablesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 19987 Accepted Submission(s): 9942Problem DescriptionToday is
2015-12-08 12:25:09 341
原创 poj 2063 Investment 贪心+完全背包
InvestmentTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 9598 Accepted: 3335DescriptionJohn never knew he had a grand-uncle, until he received the no
2015-12-07 17:31:30 330
原创 poj 3260 The Fewest Coins 混合背包+上限处理 ★★★
The Fewest CoinsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 5872 Accepted: 1763DescriptionFarmer John has gone to town to buy some farm supplies.
2015-12-07 11:52:08 386
原创 poj 3181 Dollar Dayz 钱币兑换问题 大数/高精度 完全背包
Dollar DayzTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5289 Accepted: 2006DescriptionFarmer John goes to Dollar Days at The Cow Store and discover
2015-12-06 18:35:53 499
原创 uva 147 - Dollars 钱币兑换问题(浮点数) 精度问题 完全背包
题目:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=&problem=83&mosmsg=Submission+received+with+ID+16544004要对精度作出处理,其余和一般的钱币兑换问题一样。对于计数dp,一定要想到l
2015-12-06 15:31:25 506
原创 hdu 4281 Judges' response 状压DP+TSP ★★★★
Judges' responseTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 678 Accepted Submission(s): 389Problem Description The conte
2015-12-06 12:20:56 634
原创 hdu 2126 Buy the souvenirs 01背包+计数dp
Buy the souvenirsTime Limit: 10000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1647 Accepted Submission(s): 606Problem DescriptionWhen the
2015-12-04 18:51:16 421
原创 hdu 3466 Proud Merchants 01背包 (顺序性)
Proud MerchantsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 3989 Accepted Submission(s): 1658Problem DescriptionRecently,
2015-12-04 13:26:36 368
原创 poj 2923 Relocation 状压DP
RelocationTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2906 Accepted: 1170DescriptionEmma and Eric are moving to their new house they bought after re
2015-12-03 00:10:14 433
原创 UVA 674 Coin Change 钱币兑换问题 类似完全背包
题目:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=114&page=show_problem&problem=615虽然网上说这是基础题,感觉其实并不简单,虽然有人将此题归为完全背包,但感觉和经典的背包转移还是有些差别。dp[x][i]表示体积为x时的,前i种物
2015-12-02 16:42:05 405
原创 hdu 2639 Bone Collector II 01背包 第k优解
Bone Collector IITime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3338 Accepted Submission(s): 1716Problem DescriptionThe titl
2015-12-01 23:16:18 294
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人