08 2012 档案
摘要:kb神的博客:http://www.cnblogs.com/kuangbin/archive/2012/08/26/2657446.htmlkb神的推荐: http://blog.163.com/baobao_zhang@126/blog/static/48252367200862682748461/ http://www.cnblogs.com/DreamUp/archive/2010/08/18/1802039.html http://www.cppblog.com/xfstart07/archive/2010/08/05/122356....
阅读全文
摘要:转载来自:http://blog.csdn.net/sunandice/article/details/6560889问题描述:约瑟夫环(Josephus)问题是[1]由古罗马的史学家约瑟夫(Josephus)提出的,他参加并记录了公元66—70年犹太人反抗罗马的起义。约瑟夫作为一个将军,设法守住了裘达伯特城达47天之久,在城市沦陷之后,他和40名死硬的将士在附近的一个洞穴中避难。在那里,这些叛乱者表决说“要投降毋宁死”。于是,约瑟夫建议每个人轮流杀死他旁边的人,而这个顺序是由抽签决定的。约瑟夫有预谋地抓到了最后一签,并且,作为洞穴中的两个幸存者之一,他说服了他原先的牺牲品一起投降了罗马。 约
阅读全文
摘要:转载来自kb神的推荐:http://cplusplus.com/reference/clibrary/cmath/很多基础的东西都没有记住啊注意数据类型的定义,貌似用double比较保险的说。。。headercmath (math.h)C numerics librarycmathdeclares a set of functions to compute common mathematical operations and transformations:Trigonometric functions:cosCompute cosine(function) ...
阅读全文
摘要:题目来源,多校联合赛:http://acm.hdu.edu.cn/diy/contest_showproblem.php?cid=16820&pid=1002(重开,密码:52acm8)注意:貌似过了这段时间不能提交了的说。。。。。。K次方Time Limit : 2000/1000ms (Java/Other)Memory Limit : 65535/32768K (Java/Other)Total Submission(s) : 31Accepted Submission(s) : 15Font:Times New Roman|Verdana|GeorgiaFont Size:←→
阅读全文
摘要:用线段划分平面(实质线段相交问题)原题链接:http://acm.fzu.edu.cn/problem.php?pid=1015来源:CSUST组织的多校联合组队赛第一场D题列强瓜分。2012年8月5日12:00到17:00Problem 1015 土地划分Accept: 561Submit: 1296Time Limit: 1000 mSecMemory Limit : 32768 KBProblem Description在Dukeswood这块土地上生活着一个富有的农庄主和他的几个孩子。在他临终时,他想把他的土地分给他的孩子。他有许多农场,每个农场都是一块矩形土地。他在农场地图上划上一些
阅读全文
摘要:思想深奥,代码操简单的数学问题。题目链接:http://poj.org/problem?id=3219CSUST 2012年暑假8月组队后个人赛第12场:http://acm.hust.edu.cn:8080/judge/contest/view.action?cid=11900#problem/DD -Binomial CoefficientsTime Limit:1000MSMemory Limit:131072KB64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 3219DescriptionThe binomial coe
阅读全文
摘要:原创链接:http://blog.163.com/zhaohai_1988/blog/static/209510085201263011135062/感谢作者,感谢kb神的推荐~~~~~~问题描述RMQ问题是求给定区间中的最值问题。对于长度为n的数列A,回答若干查询RMQ(A, i, j)。返回数组A中下标在[i,j]里的最小值的下标。比如数列 5,8,1,3,6,4,9,5,7 那么RMQ(2,4) = 3, RMQ(6,9) = 6.解决问题最简单的解法时间复杂度是O(n),就是对于每一个查询遍历一遍数组。但是当n非常大的时候,并且查询次数非常多的时候,这个解决方案就不是那么高效了。使..
阅读全文
摘要:唉,我的入门“hash”题目链接:http://poj.org/problem?id=1840CSUST 2012年暑假8月组队后第十二次个人赛:http://acm.hust.edu.cn:8080/judge/contest/view.action?cid=11900#problem/BEqsTime Limit:5000MSMemory Limit:65536KTotal Submissions:8973Accepted:4446DescriptionConsider equations having the following form:a1x13+ a2x23+ a3x33+ a4x
阅读全文
摘要:计算几何(判断线段是否相交问题)题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1648CSUST 2012年暑假8月组队后个人训练赛第11场,题目A:http://acm.hust.edu.cn:8080/judge/contest/view.action?cid=11851#problem/A另外附上一个很牛逼的博客的判断线段相交问题:http://www.cnblogs.com/g0feng/archive/2012/05/18/2508293.htmlCircuit BoardTime Limit:2
阅读全文
摘要:彻底膜拜啊!不过视频不好弄,这里贴个网址:http://www.apkbus.com/android-64790-1-1.html
阅读全文
摘要:写的很好的一个模板,感谢作者。文章来源:http://www.cppblog.com/acronix/archive/2010/08/23/124470.aspx?opt=admin下面是 m^n % k 的快速幂:// m^n % k
int quickpow(int m,int n,int k)
{ int b = 1; while (n > 0) { if (n & 1) b = (b*m)%k; n = n >> 1 ; m = (m*m)%k; } retur...
阅读全文
摘要:题目链接:http://poj.org/problem?id=1862CSUST2012年8月19日暑假组队后第10次个人训练赛http://acm.hust.edu.cn:8080/judge/contest/view.action?cid=11732#problem/BPOJ1862StripiesTimeLimit:1000MSMemoryLimit:30000KTotalSubmissions:9477Accepted:4610DescriptionOurchemicalbiologistshaveinventedanewveryusefulformoflifecalledstripi
阅读全文
摘要:原作者早已不知道是哪位教主了,但是这是本人最喜欢的一篇ACM的文章了,今日一时兴起,就复制了过来~~~~~~这是我看过的写的最好的一篇了。转载出处(也非原创):http://acmore.sinaapp.com/blog/blog_detail.php?id=3题解:还记得2年前的一个晚上,我和一个女孩一起写完了这篇文章。写完后,她哭了,我笑了。然后,她走了,我哭了。2年后,我又找到她,这次,我没有让她走掉,她成了我的新娘。不知道什么时候,开始知道ACM;也不知道什么时候,开始喜欢上ACM。但是,我知道,我喜欢上了,而且不会后悔。我是大一的时候进的学校ACM队,那个时候,一切都是冰冷的,...
阅读全文
摘要:原文复制地址来自:http://page.renren.com/601332152/note/862709920很搞笑啊,不过还是喜欢acmRoBa原创,转载请注明出处劳资六年前开始搞ACM啊!!!!!!!!!!从此踏上了尼玛不归路啊!!!!!!!!!!!!谁特么跟劳资讲算法是程序设计的核心啊!!!!!!尼玛除了面试题就没见过用算法的地方啊!!!!!!谁再跟劳资讲算法之美算法的力量,劳资一本算法导论拍死你啊!!!!!!!!那是搞ACM的入门书啊!!!!特么的入门书就一千多页啊!!!!!!!还没有习题答案啊,学完了你特么都不知道自己到底会不会啊有木有!!!!!!然后你就得看lrj的黑书啊!!!!
阅读全文
摘要:原文复制地址(注意此处也非原创):http://page.renren.com/601332152/note/862709920很搞笑啊。O(∩_∩)O哈哈~但是还是喜欢acm。你们懂的~~~~~~RoBa原创,转载请注明出处劳资六年前开始搞ACM啊!!!!!!!!!!从此踏上了尼玛不归路啊!!!!!!!!!!!!谁特么跟劳资讲算法是程序设计的核心啊!!!!!!尼玛除了面试题就没见过用算法的地方啊!!!!!!谁再跟劳资讲算法之美算法的力量,劳资一本算法导论拍死你啊!!!!!!!!那是搞ACM的入门书啊!!!!特么的入门书就一千多页啊!!!!!!!还没有习题答案啊,学完了你特么都不知道自己到底会
阅读全文
摘要:转载复制来自:http://blog.163.com/36142114@qq.com/blog/static/168816502201072042753754/原作者:牛b的Matrix67(听说是初中时写的)百度文档下载:http://wenku.baidu.com/view/600f37d380eb6294dd886c18.html###推荐kb神的KMP博客:http://www.cnblogs.com/kuangbin/archive/2012/08/14/2638803.html还是推荐到我的CSDN中看 :http://blog.csdn.net/cfreezhan/article
阅读全文
摘要:快速链接:http://poj.org/problem?id=2063CSUST 2012年暑假8月组队后第八次个人赛:http://acm.hust.edu.cn:8080/judge/contest/view.action?cid=11473#problem/DInvestmentTime Limit:1000MSMemory Limit:30000KTotal Submissions:5370Accepted:1848DescriptionJohn never knew he had a grand-uncle, until he received the notary's le
阅读全文
摘要:DP背包(注意减少内存的转换)快速链接:http://poj.org/problem?id=2063CSUST 2012年暑假8月组队后第八次个人赛:http://acm.hust.edu.cn:8080/judge/contest/view.action?cid=11473#problem/DInvestmentTime Limit:1000MSMemory Limit:30000KTotal Submissions:5370Accepted:1848DescriptionJohn never knew he had a grand-uncle, until he received the
阅读全文
摘要:经典的模拟队列题目题目链接: http://poj.org/problem?id=31252012年8月7日,暑假组队后个人训练赛第一场Printer QueueTime Limit:1000MSMemory Limit:65536KTotal Submissions:3082Accepted:1655DescriptionThe only printer in the computer science students' union is experiencing an extremely heavy workload. Sometimes there are a hundred j
阅读全文
摘要:经典的模拟队列题目题目链接: http://poj.org/problem?id=31252012年8月7日,暑假组队后个人训练赛第一场Printer QueueTime Limit:1000MSMemory Limit:65536KTotal Submissions:3082Accepted:1655DescriptionThe only printer in the computer science students' union is experiencing an extremely heavy workload. Sometimes there are a hundred j
阅读全文
摘要:题目链接: http://poj.org/problem?id=31252012年8月7日,暑假组队后个人训练赛第一场Printer QueueTime Limit:1000MSMemory Limit:65536KTotal Submissions:3082Accepted:1655DescriptionThe only printer in the computer science students' union is experiencing an extremely heavy workload. Sometimes there are a hundred jobs in th
阅读全文
摘要:递归和打表找规律或者记忆化搜索题目链接:http://poj.org/problem?id=15792012年暑假组队后第一场个人训练赛FunctionRunFunTimeLimit:1000MSMemoryLimit:10000KTotalSubmissions:13148Accepted:6836DescriptionWeallloverecursion!Don'twe?Considerathree-parameterrecursivefunctionw(a,b,c):ifa20orb>20orc>20,thenw(a,b,c)returns:w(20,20,20)if
阅读全文
摘要:题目链接:http://poj.org/problem?id=15792012年暑假组队后第一场个人训练赛FunctionRunFunTimeLimit:1000MSMemoryLimit:10000KTotalSubmissions:13148Accepted:6836DescriptionWeallloverecursion!Don'twe?Considerathree-parameterrecursivefunctionw(a,b,c):ifa<=0orb<=0orc<=0,thenw(a,b,c)returns:1ifa>20orb>20orc&g
阅读全文
摘要:题目链接:http://poj.org/problem?id=1573 http://acm.hdu.edu.cn/showproblem.php?pid=1035Robot MotionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3893Accepted Submission(s): 1817Problem DescriptionA robot has been programmed to follow the instr...
阅读全文
摘要:题目链接:http://poj.org/problem?id=1573 http://acm.hdu.edu.cn/showproblem.php?pid=1035Robot MotionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3893Accepted Submission(s): 1817Problem DescriptionA robot has been programmed to follow the instr...
阅读全文
摘要:根据大数相加,写出的简单的大数相乘的模板,有待改进中~~~~~~#include<stdio.h>#include<string.h>const int N = 100;int main(){ int i,j,k; int d1,d2; int a[N]={0},b[N]={0},sum[2*N]={0}; char c[N];// memset(c,'0',sizeof(c));// memset(a,0,sizeof(a));// memset(b,0,sizeof(b));// memset(sum,0,sizeof(sum));// ...
阅读全文
摘要:原作者已经找不到了,但是我是从CSUST的博客栏中看到的,一个很好的模板。我看到的文章来源(不是原出处):http://blog.csdn.net/csust_acm/article/details/7268029//大数相加#include <stdio.h>#include<string.h>int main(){ int i,d,j,d1; char a[100];int b[101]={0};int c[100]={0}; // memset(b,0,sizeof(b)); // memset(c,0,sizeof(c)); scanf("%s&quo
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1025Constructing Roads In JGShining's KingdomTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9069Accepted Submission(s): 2579Problem DescriptionJGShining's kingdom consists of 2n(n is no more t
阅读全文
摘要:DP(呃,两边不交叉修路的那道。。。)题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1025Constructing Roads In JGShining's KingdomTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9069Accepted Submission(s): 2579Problem DescriptionJGShining's kingdom consists o
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1114Piggy-BankTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5450Accepted Submission(s): 2714Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial suppor
阅读全文
摘要:经典完全背包入门题目题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1114Piggy-BankTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5450Accepted Submission(s): 2714Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financ
阅读全文
摘要:DP&&英语==题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1058Humble NumbersTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9933Accepted Submission(s): 4291Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1058Humble NumbersTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9933Accepted Submission(s): 4291Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequ
阅读全文
摘要:感谢作者,感谢百度文库,原文下载地址:http://wenku.baidu.com/view/8b3c0d778e9951e79b892755.html###背包问题九讲v1.0目录第一讲01背包问题第二讲完全背包问题第三讲多重背包问题第四讲混合三种背包问题第五讲二维费用的背包问题第六讲分组的背包问题第七讲有依赖的背包问题第八讲泛化物品第九讲背包问题问法的变化附:USACO中的背包问题前言本篇文章是我(dd_engi)正在进行中的一个雄心勃勃的写作计划的一部分,这个计划的内容是写作一份较为完善的NOIP难度的动态规划总结,名为《解动态规划题的基本思考方式》。现在你看到的是这个写作计划最先发布的
阅读全文
摘要:题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=2084数塔Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11282Accepted Submission(s): 6761Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个D
阅读全文
摘要:题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1176免费馅饼Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 14396Accepted Submission(s): 4763Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2602 Bone CollectorTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13839Accepted Submission(s): 5454Problem DescriptionMany years ago , in Teddy’s hometown there was a man who was ca...
阅读全文
摘要:最经典、最基础的01背包入门题目题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2602Bone CollectorTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13839Accepted Submission(s): 5454Problem DescriptionMany years ago , in Teddy’s hometown there was a man who was called
阅读全文
摘要:最经典、最基础的01背包入门题目题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2602Bone CollectorTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13839Accepted Submission(s): 5454Problem DescriptionMany years ago , in Teddy’s hometown there was a man who was called
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1506Largest Rectangle in a HistogramTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5475Accepted Submission(s): 1570Problem DescriptionA histogram is a polygon composed of a sequence of rectangles alig
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1231最大连续子序列Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11885Accepted Submission(s): 5005Problem Description给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ...,Nj },其中 1 <= i <= j <= K
阅读全文
摘要:POJ 1573 && hdu 1035(简单模拟)感谢kb神题目链接:http://poj.org/problem?id=1573 http://acm.hdu.edu.cn/showproblem.php?pid=1035Robot MotionTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 7893Accepted: 3813DescriptionA robot has been programmed to follow the instructions in its path. Instructions
阅读全文

浙公网安备 33010602011771号