DP
阿龙的圈子
仰望星空 脚踏实地
向前走 永不停
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
微软offer收割赛之智力竞赛
#include using namespace std;const int maxn = 1000 + 10;const int INF = 0x3f3f3f3f;int n, m, s, t;int a[maxn];int dp[maxn][maxn];void solve(){ memset(dp, 0x3f, sizeof dp); memset(dp原创 2016-04-20 08:06:37 · 628 阅读 · 0 评论 -
uva 动态规划 437 The Tower of Babylon
The Tower of BabylonTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionPerhaps you have heard of the legend of the原创 2015-08-07 13:06:49 · 692 阅读 · 0 评论 -
hdu 5375 多校
Gray codeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 604 Accepted Submission(s): 357Problem DescriptionThe reflected bina原创 2015-08-12 20:51:25 · 788 阅读 · 0 评论 -
01背包 动态规划
C. Dima and Saladtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDima, Inna and Seryozha have gathered in a原创 2015-08-12 19:39:17 · 864 阅读 · 0 评论 -
BestCoders
Senior's StringTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 466 Accepted Submission(s): 183Problem DescriptionXuejiejie lo原创 2015-07-17 15:52:28 · 966 阅读 · 0 评论 -
poj
PearlsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 7887 Accepted: 3915DescriptionIn Pearlania everybody is fond of pearls. One company, called The原创 2015-07-16 19:51:14 · 702 阅读 · 0 评论 -
POJ
The Cow LexiconTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 8678 Accepted: 4092DescriptionFew know that the cows have their own dictionary with W (1原创 2015-07-16 14:08:32 · 146 阅读 · 0 评论 -
HDU 1466 直线交点情况
的BestCoder(有米!)计算直线的交点数Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8881 Accepted Submission(s): 4006Problem Descr原创 2015-08-09 11:53:48 · 761 阅读 · 0 评论 -
POJ
Language:DefaultAlignmentTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 14202 Accepted: 4588DescriptionIn the army, a platoon is composed by n so原创 2015-07-16 18:49:01 · 693 阅读 · 0 评论 -
hdu 5410
CRB and His BirthdayTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 625 Accepted Submission(s): 325Problem DescriptionToday i原创 2015-08-24 17:40:55 · 798 阅读 · 0 评论 -
动态规划 uva 1025
Secret agent Maria was sent to Algorithms City to carry out an especially dangerous mission. Afterseveral thrilling events we find her in the first station of Algorithms City Metro, examining the ti原创 2015-08-07 09:56:38 · 1195 阅读 · 0 评论 -
uva11077
点击打开题目链接题解: 动态规划,首先我们要掌握动态规划的过程,在递推环节中,对某个节点进行全面的分类讨论,确定递推关系式,然后确定初始条件。#include #include #define N 30unsigned long long d[N][N];int n, k;void pre_do(){ memset(d, 0, sizeof d);原创 2015-09-27 10:27:11 · 672 阅读 · 0 评论 -
HDU 5542
The Battle of ChibiTime Limit: 6000/4000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 187 Accepted Submission(s): 68Problem DescriptionCao Cao m原创 2015-11-07 11:14:13 · 1300 阅读 · 0 评论 -
切百度之星水题
大搬家 Accepts: 527 Submissions: 2062 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem Description近期B厂组织了一次大搬家,所有人都要按照指示换到指定的座位上。原创 2016-05-12 18:06:11 · 482 阅读 · 0 评论 -
poj 1062
昂贵的聘礼Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 42430 Accepted: 12416Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给原创 2016-01-02 11:57:28 · 535 阅读 · 0 评论 -
ZOJ 1679
TelescopeTime Limit: 5 Seconds Memory Limit: 32768 KBDr. Extreme experimentally made an extremely precise telescope to investigate extremely curious phenomena at an extremely distant pl原创 2016-01-15 22:41:53 · 646 阅读 · 0 评论 -
关于动态规划的理解
对于动态规划的理解 从大二起,也做了不少的动态规划题,但对于很多动态规划状态还是一知半解,究其原因,是在平时做题的过程中,不求甚解,遇到问题只是匆匆看看题解,而不深入探讨。导致很多问题都模模糊糊的过去了,做题也等于没有做。从现在开始正式的反思总结。新的一年,新的开始^_^ 1. ZOJ 1679 Telescope 题意:这道题是给出一个圆,上面有n个点,从中选出m个点,选择一种方原创 2016-01-15 22:38:44 · 784 阅读 · 0 评论 -
HDU4455
SubstringsTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2581 Accepted Submission(s): 798Problem DescriptionXXX has an arra原创 2015-11-01 19:53:36 · 674 阅读 · 0 评论 -
zoj3905
CakeTime Limit: 4 Seconds Memory Limit: 65536 KBAlice and Bob like eating cake very much. One day, Alice and Bob went to a bakery and bought many cakes.Now we know that they have boug原创 2015-11-12 15:27:10 · 682 阅读 · 0 评论 -
HDU 4810 Wall Painting
Wall PaintingTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2048 Accepted Submission(s): 651Problem DescriptionMs.Fang love原创 2015-10-10 16:31:14 · 475 阅读 · 0 评论 -
Bestcoders 56 Clarke and problem
Clarke and problem Accepts: 169 Submissions: 372 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionClarke is a patie原创 2015-09-20 20:52:47 · 528 阅读 · 0 评论 -
hdu 5543
New~ 欢迎参加——计算机学院大学生程序设计竞赛(新生为主) Pick The SticksTime Limit: 15000/10000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 303 Accepted Submission(s):原创 2015-11-08 20:58:06 · 891 阅读 · 0 评论 -
uva 116
Unidirectional TSPTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionBackgroundProblems that require minimum p原创 2015-08-07 17:08:11 · 652 阅读 · 0 评论 -
uva 1347
TourTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionJohn Doe, a skilled pilot, enjoys traveling. While on vacat原创 2015-08-07 15:45:13 · 762 阅读 · 0 评论 -
叉乘、快速排斥与跨立实验及求取三角形面积
叉乘(一)判断方向(二)判断线段相交(三)求三角形面积(一)判断方向叉乘的性质如下: (1). P x Q > 0; 表示P在Q的顺时针方向; (2). p x Q < 0; 表示P在Q的逆时针方向; (3). P x Q = 0; 表示P和Q是共线的 P(x1,y1),Q(x2,y2), P*Q=x1y2-x2y1 判断结果三种状态模版为:struct p原创 2014-11-10 19:30:17 · 1427 阅读 · 0 评论 -
最优矩阵链乘
#include #include #include #include #include #include #define INF 1using namespace std;int p[105],f[105][105];int min(int a, int b){ return a}int main(){ in原创 2014-11-09 15:45:44 · 758 阅读 · 1 评论 -
区间dp
区间DP区间DP注意点例题:1.最优矩阵链乘2.UVA 10003 Cutting Sticks注意点区间dp与一般的dp有所区别,若使用递推的方法,需要注意根据dp[i][j] 中j-i递增的顺序来递推。例题:1.最优矩阵链乘#include #include原创 2014-11-10 13:09:04 · 979 阅读 · 0 评论 -
UVA 10003 Cutting sticks
#include #include #include using namespace std;#define maxn 100000int p[55],dp[55][55];int main(){ int L,n; while(cin>>L&&L) { memset(dp,0,sizeof(dp)); cin>>n;原创 2014-11-09 22:19:10 · 625 阅读 · 0 评论 -
UVA 11584 Partitioning by Palindromes
Problem H: Partitioning by PalindromesWe say a sequence of characters is a palindrome if it is the same written forwards and backwards. For example, 'racecar' is a palindrome, but 'fastcar' is not原创 2014-11-08 15:08:13 · 1049 阅读 · 0 评论 -
背包
@JintianGo 2014-11-08 10:44 字数 2396 阅读 1模板背包背包一.01背包:(每种背包零或一)二.完全背包:(每种数量不限)三.多重背包:(每种背包数量给出)四.完整程序五.例题1(POJ1276)2(UVA12653)一.01背包:(每种背包零或一原创 2014-11-08 10:46:35 · 709 阅读 · 0 评论 -
UVA 11400 Lighting System Design
Problem FLighting System DesignInput: Standard InputOutput: Standard Output You are given the task to design a lighting system for a huge conference hall. After doing a lot of calculation &原创 2014-11-07 20:24:20 · 724 阅读 · 0 评论 -
POJ1276 Cash Machine
Language:DefaultCash MachineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 27946 Accepted: 9973DescriptionA Bank plans to install a machine for c原创 2014-11-07 16:05:39 · 740 阅读 · 0 评论 -
UVA 1625 Color Length
ICPC 2011 Asia Regional Daejeon Problem C: Color Length The 36th Annual ACM International Collegiate Programming Contest Asia Regional - Daejeon Problem C Color Length Cars painted in diff原创 2014-11-08 20:53:16 · 2054 阅读 · 2 评论 -
poj 2066
Minimax TriangulationTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 820 Accepted: 255DescriptionTriangulation of surfaces has applications in the Finit原创 2014-11-10 21:44:52 · 1155 阅读 · 0 评论 -
uva 12186
A couple of years ago, a new world wide crisis started, leaving many people with economical problems. Some workers of a particular company are trying to ask for an increase in their salaries.The c原创 2014-11-11 19:44:14 · 752 阅读 · 0 评论 -
poj 1141 Brackets Squence
Brackets SequenceTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 25965 Accepted: 7323 Special JudgeDescriptionLet us define a regular brackets seque原创 2014-11-10 16:11:06 · 715 阅读 · 0 评论 -
bestcoders Happy Birthday
Happy birthday Accepts: 178 Submissions: 511 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)问题描述今天是Gorwin的生日。所以她的妈妈要实现她的一个愿望。Gorwin说她想吃很多蛋原创 2015-05-28 22:08:01 · 717 阅读 · 0 评论 -
Hihocoder 挑战赛
题目1 : 随机斐波那契时间限制:5000ms单点时限:1000ms内存限制:256MB描述大家对斐波那契数列想必都很熟悉:a0 = 1, a1 = 1, ai = ai-1 + ai-2,(i > 1)。现在考虑如下生成的斐波那契数列:a0 = 1, ai = aj + ak, i > 0, j, k从[0,原创 2015-05-03 19:51:29 · 666 阅读 · 0 评论 -
hdu 4405
//#include //#include //#include ////using namespace std;//#define maxn 100000+10////int n, m;//bool vis[maxn];//double d[maxn];//int a[maxn];//////double dp(int k)//{//// if(vis[k]原创 2015-03-21 21:10:21 · 715 阅读 · 0 评论 -
uva 11762
#include #include #include #include using namespace std;#define MAX 1000010#define MAXP 700000int vis[MAX];int prime[MAXP];int n;double dp[MAX];bool flag[MAX];int primes_num;void sieve原创 2015-03-21 18:52:40 · 873 阅读 · 0 评论
分享