上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: poj3273——经典的二分优化Monthly ExpenseTime Limit:2000MSMemory Limit:65536KTotal Submissions:16522Accepted:6570DescriptionFarmer John is an astounding account... 阅读全文
posted @ 2015-03-30 10:55 __560 阅读(290) 评论(0) 推荐(0) 编辑
摘要: poj1061——扩展gcd水题青蛙的约会Time Limit:1000MSMemory Limit:10000KTotal Submissions:94176Accepted:17413Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一... 阅读全文
posted @ 2015-03-27 23:00 __560 阅读(324) 评论(0) 推荐(0) 编辑
摘要: poj2115——拓展欧几里德求模线性同余方程的最小正整数解C LooooopsTime Limit:1000MSMemory Limit:65536KTotal Submissions:18926Accepted:4973DescriptionA Compiler Mystery: We are ... 阅读全文
posted @ 2015-03-27 20:38 __560 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 拓展欧几里德算法对贝祖等式:ax+by=gcd(a,b); 一定存在整数解,求x最小的整数解x,y (x,y可以是负数)#include#include#include#include#includeusing namespace std;const int maxn=1000100;const i... 阅读全文
posted @ 2015-03-27 19:21 __560 阅读(241) 评论(0) 推荐(0) 编辑
摘要: poj1845——二分递归求等比数列前n项和,根号剪枝SumdivTime Limit:1000MSMemory Limit:30000KTotal Submissions:15268Accepted:3764DescriptionConsider two natural numbers A and... 阅读全文
posted @ 2015-03-26 23:34 __560 阅读(437) 评论(0) 推荐(0) 编辑
摘要: 打印素数表筛选法void play_prime(){ //打印isprime(bool)表 memset(isprime,1,sizeof(isprime)); isprime[1]=0; for(int i=2;i<maxn;i++){ if(!isprime... 阅读全文
posted @ 2015-03-26 00:29 __560 阅读(221) 评论(0) 推荐(0) 编辑
摘要: poj3292——筛选法Semi-prime H-numbersTime Limit:1000MSMemory Limit:65536KTotal Submissions:7772Accepted:3360DescriptionThis problem is based on an exercise... 阅读全文
posted @ 2015-03-26 00:13 __560 阅读(202) 评论(0) 推荐(0) 编辑
摘要: poj2635——同余模定理,打印素数表The Embarrassed CryptographerTime Limit:2000MSMemory Limit:65536KTotal Submissions:12603Accepted:3367DescriptionThe young and very... 阅读全文
posted @ 2015-03-25 21:03 __560 阅读(264) 评论(0) 推荐(0) 编辑
摘要: poj1942——组合数学Paths on a GridTime Limit:1000MSMemory Limit:30000KTotal Submissions:22473Accepted:5522DescriptionImagine you are attending your math les... 阅读全文
posted @ 2015-03-25 17:46 __560 阅读(239) 评论(0) 推荐(0) 编辑
摘要: poj3252——组合数学Round NumbersTime Limit:2000MSMemory Limit:65536KTotal Submissions:9790Accepted:3517DescriptionThe cows, as you know, have no fingers or ... 阅读全文
posted @ 2015-03-25 11:32 __560 阅读(234) 评论(0) 推荐(0) 编辑
摘要: hduoj1753——java大明A+BTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9321Accepted Submission(s): 33... 阅读全文
posted @ 2015-03-25 02:04 __560 阅读(241) 评论(0) 推荐(0) 编辑
摘要: poj1019——log10求位数Number SequenceTime Limit:1000MSMemory Limit:10000KTotal Submissions:35084Accepted:10099DescriptionA single positive integer i is giv... 阅读全文
posted @ 2015-03-24 21:36 __560 阅读(284) 评论(0) 推荐(0) 编辑
摘要: poj2084——卡特兰数Game of ConnectionsTime Limit:1000MSMemory Limit:30000KTotal Submissions:7647Accepted:3865DescriptionThis is a small but ancient game. Yo... 阅读全文
posted @ 2015-03-24 13:56 __560 阅读(246) 评论(0) 推荐(0) 编辑
摘要: hdoj1023——卡特兰数Train Problem IITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6418Accepted Submiss... 阅读全文
posted @ 2015-03-24 13:33 __560 阅读(202) 评论(0) 推荐(0) 编辑
摘要: poj1496——组合数学Word IndexTime Limit:1000MSMemory Limit:10000KTotal Submissions:4740Accepted:2692DescriptionEncoding schemes are often used in situations... 阅读全文
posted @ 2015-03-23 23:13 __560 阅读(229) 评论(0) 推荐(0) 编辑
摘要: poj1850——组合数学CodeTime Limit:1000MSMemory Limit:30000KTotal Submissions:8492Accepted:4020DescriptionTransmitting and memorizing information is a task t... 阅读全文
posted @ 2015-03-23 23:08 __560 阅读(219) 评论(0) 推荐(0) 编辑
摘要: bestcoder#29 1002 矩阵连乘快速幂解fib数列GTY's birthday gift Accepts: 103 Submissions: 585 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K... 阅读全文
posted @ 2015-03-23 13:28 __560 阅读(283) 评论(0) 推荐(0) 编辑
摘要: bestcoder#28 1002 dfsFibonacci Accepts: 40 Submissions: 996 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Proble... 阅读全文
posted @ 2015-03-23 00:52 __560 阅读(224) 评论(0) 推荐(0) 编辑
摘要: poj1458——dp,lcsCommon SubsequenceTime Limit:1000MSMemory Limit:10000KTotal Submissions:40529Accepted:16351DescriptionA subsequence of a given sequence... 阅读全文
posted @ 2015-03-22 00:53 __560 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 排序Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 38410Accepted Submission(s): 10894Problem Descri... 阅读全文
posted @ 2015-03-21 17:35 __560 阅读(286) 评论(0) 推荐(0) 编辑
摘要: codeforces#296div2_b 字符串,图B. Error Correct Systemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outpu... 阅读全文
posted @ 2015-03-21 16:04 __560 阅读(281) 评论(0) 推荐(0) 编辑
摘要: codeforces#296div2_a 模拟A. Playing with Papertime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne... 阅读全文
posted @ 2015-03-21 15:56 __560 阅读(265) 评论(0) 推荐(0) 编辑
摘要: hduoj1159 dp,lcsCommon SubsequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 25570Accepted Su... 阅读全文
posted @ 2015-03-21 01:35 __560 阅读(191) 评论(0) 推荐(0) 编辑
摘要: poj1159——回文,lcsPalindromeTime Limit:3000MSMemory Limit:65536KTotal Submissions:54621Accepted:18892DescriptionA palindrome is a symmetrical string, tha... 阅读全文
posted @ 2015-03-21 01:00 __560 阅读(211) 评论(0) 推荐(0) 编辑
摘要: hduoj1025——dp, lisConstructing Roads In JGShining's KingdomTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submis... 阅读全文
posted @ 2015-03-20 23:27 __560 阅读(254) 评论(0) 推荐(0) 编辑
摘要: poj1080——lcs变形,dpHuman Gene FunctionsTime Limit:1000MSMemory Limit:10000KTotal Submissions:17610Accepted:9821DescriptionIt is well known that a human ... 阅读全文
posted @ 2015-03-20 21:11 __560 阅读(223) 评论(0) 推荐(0) 编辑
摘要: lis(最长上升子序列) dp求序列的lis,子序列可不连续 for(int i=1;ians) ans=dp[i]; } printf("%d\n",ans);View Code上面的算法是n^2的,现在补充nlogn的算法,下面算法手动模拟一下不难理解#include#incl... 阅读全文
posted @ 2015-03-20 19:59 __560 阅读(318) 评论(0) 推荐(0) 编辑
摘要: lcs(最长公共子序列)求两个序列的lcs的长度,子序列可不连续dp[i][j]=dp[i-1][j-1]+1(a[i]==b[i])dp[i][j]=max(dp[i-1][j],dp[i][j-1])(a[i]!=b[i]) memset(dp,0,sizeof(dp)); for(... 阅读全文
posted @ 2015-03-20 19:56 __560 阅读(267) 评论(0) 推荐(0) 编辑
摘要: poj3176——dpCow BowlingTime Limit:1000MSMemory Limit:65536KTotal Submissions:14683Accepted:9764DescriptionThe cows don't use actual bowling balls when ... 阅读全文
posted @ 2015-03-20 18:32 __560 阅读(193) 评论(0) 推荐(0) 编辑
摘要: poj2533——lis(最长上升子序列), 线性dpLongest Ordered SubsequenceTime Limit:2000MSMemory Limit:65536KTotal Submissions:36143Accepted:15876DescriptionA numeric se... 阅读全文
posted @ 2015-03-20 18:17 __560 阅读(205) 评论(0) 推荐(0) 编辑
摘要: poj1260——线性dpPearlsTime Limit:1000MSMemory Limit:10000KTotal Submissions:7705Accepted:3811DescriptionIn Pearlania everybody is fond of pearls. One com... 阅读全文
posted @ 2015-03-20 12:35 __560 阅读(208) 评论(0) 推荐(0) 编辑
摘要: poj1836——dp,最长上升子序列(lis)AlignmentTime Limit:1000MSMemory Limit:30000KTotal Submissions:13767Accepted:4450DescriptionIn the army, a platoon is composed... 阅读全文
posted @ 2015-03-20 00:12 __560 阅读(259) 评论(0) 推荐(0) 编辑
摘要: poj3267——线性dpThe Cow LexiconTime Limit:2000MSMemory Limit:65536KTotal Submissions:8458Accepted:3993DescriptionFew know that the cows have their own di... 阅读全文
posted @ 2015-03-19 22:20 __560 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 背包问题目前已经学了三种背包问题,是时候整理一下模版了01背包这是最基础的背包问题,即每件物品只能取一次,问背包能装的不超过容量的最大价值方程:dp[i][j]=max{dp[i-1][j],dp[i-1][j-w[i]]+val[i]}(j>=w[i]) 边界:dp[i][j]=dp[i-1... 阅读全文
posted @ 2015-03-18 22:14 __560 阅读(268) 评论(0) 推荐(0) 编辑
摘要: poj1276——dp,多重背包Cash MachineTime Limit:1000MSMemory Limit:10000KTotal Submissions:28826Accepted:10310DescriptionA Bank plans to install a machine for ... 阅读全文
posted @ 2015-03-18 21:39 __560 阅读(234) 评论(0) 推荐(0) 编辑
摘要: hihocoder1038 01背包时间限制:20000ms单点时限:1000ms内存限制:256MB描述且说上一周的故事里,小Hi和小Ho费劲心思终于拿到了茫茫多的奖券!而现在,终于到了小Ho领取奖励的时刻了!小Ho现在手上有M张奖券,而奖品区有N件奖品,分别标号为1到N,其中第i件奖品需要nee... 阅读全文
posted @ 2015-03-18 17:44 __560 阅读(266) 评论(0) 推荐(0) 编辑
摘要: POJ 1384 dp,完全背包Piggy-BankTime Limit:1000MSMemory Limit:10000KTotal Submissions:8404Accepted:4082DescriptionBefore ACM can do anything, a budget must ... 阅读全文
posted @ 2015-03-17 23:19 __560 阅读(364) 评论(0) 推荐(0) 编辑
摘要: POJ 1837 dpBalanceTime Limit:1000MSMemory Limit:30000KTotal Submissions:11278Accepted:7017DescriptionGigel has a strange "balance" and he wants to poi... 阅读全文
posted @ 2015-03-16 11:30 __560 阅读(237) 评论(0) 推荐(0) 编辑
摘要: POJ 3982 大数序列Time Limit:1000MSMemory Limit:65536KTotal Submissions:7191Accepted:3243Description数列A满足An = An-1 + An-2 + An-3, n >= 3编写程序,给定A0, A1 和 A2,... 阅读全文
posted @ 2015-03-16 00:03 __560 阅读(182) 评论(0) 推荐(0) 编辑
摘要: poj3624 01背包 dp+滚动数组Charm BraceletTime Limit:1000MSMemory Limit:65536KTotal Submissions:25458Accepted:11455DescriptionBessie has gone to the mall's je... 阅读全文
posted @ 2015-03-15 23:11 __560 阅读(317) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 下一页