poj
文章平均质量分 82
wangqi1113
这个作者很懒,什么都没留下…
展开
-
POJ 1012 Joseph
DescriptionThe Joseph's problem is notoriously known. For those who are not familiar with the original problem: from among n people, numbered 1, 2, . . ., n, standing in circle every mth is going to b...原创 2018-04-15 13:46:38 · 139 阅读 · 0 评论 -
poj2965 The Pilots Brothers' refrigerator
DescriptionThe game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a refrigerator.There are 16 handles on the refrigerator door. Every handle can be in o...原创 2018-06-30 17:23:49 · 124 阅读 · 0 评论 -
poj 1753
DescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the other one is black and each piece is lying eit...原创 2018-06-30 16:01:14 · 161 阅读 · 0 评论 -
滑雪
滑雪Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 104919 Accepted: 39951DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维...原创 2018-05-16 18:04:34 · 591 阅读 · 3 评论 -
Moving Tables
Moving TablesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 33739 Accepted: 11268DescriptionThe famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is ...原创 2018-05-16 16:07:58 · 312 阅读 · 0 评论 -
Human Gene Functions
简单说就是最长公共子序列的变种。dp[i][j]表示串s1[0..i]和串s2[0...j]的最长公共子序列故dp[i][j] = max(dp[i-1][j-1] + matrix[s1[i-1]][s2[j-1]] 表示串s1的第i个字符和串s2的第j个字符匹配dp[i-1][j]+matrix[s1[i-1]]['-'] 表示串s1的第i个字符和'-'匹配dp[i][j-1]+matrix[...原创 2018-05-15 21:57:05 · 1174 阅读 · 0 评论 -
Parencodings 1068
DescriptionLet S = s1 s2...s2n be a well-formed string of parentheses. S can be encoded in two different ways:q By an integer sequence P = p1 p2...pn where pi is the number of left parentheses before...原创 2018-05-15 20:58:46 · 161 阅读 · 0 评论 -
最长子段和 最大子矩阵
最长字段和 数组a[0...n],求出max a[i..j]的和用dp的思想做 dp[i]表示从a[0]到a[i]的最长子段和,并且肯定包含a[i],则原问题转换成求max dpdp[i] = max(dp[i-1]+a[i],a[i])故若dp[i-1]>0,则dp[i] = dp[i-1]+a[i];若dp[i-1]<0,则dp[i]=a[i];int maxSum(int ...原创 2018-05-15 18:07:54 · 234 阅读 · 0 评论 -
欧几里得算法
欧几里得算法 -- 求最大公约数int GCD(int a,int b){ if(b == 0){ return a; } return GCD(b,a%b);}一般希望 a>b,加速迭代过程。扩展欧几里得算法 -- ax+by=gcd(a,b)=d__int64 exGCD(__int64 a,__int64 b,__int64 &x,__...原创 2018-05-15 16:21:35 · 280 阅读 · 0 评论 -
poj 1019 Number Sequence
DescriptionA single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2...Sk. Each group Sk consists of a sequence of positiv...原创 2018-05-05 16:05:03 · 272 阅读 · 0 评论 -
poj 1018 Communication System
DescriptionWe have received an order from Pizoor Communications Inc. for a special communication system. The system consists of several devices. For each device, we are free to choose from several man...原创 2018-05-04 12:34:58 · 130 阅读 · 0 评论 -
1023 The Fun Number System
Description In a k bit 2’s complement number, where the bits are indexed from 0 to k-1, the weight of the most significant bit (i.e., in position k-1), is -2^(k-1), and the weight of a bit in any pos...原创 2018-05-10 16:54:39 · 190 阅读 · 0 评论 -
poj 1017 Packets
poj 1017DescriptionA factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These products are always delivered to customers in the squa...原创 2018-05-03 20:08:12 · 138 阅读 · 0 评论 -
0-1背包 完全背包 多重背包 Dividing poj1014
背包问题:一个背包总容量为w, 现在有n个物品, 第i个物品容量为weight[i], 价值为value[i], 现在往背包里面装东西, 怎样装才能使背包内物品总价值最大。主要分为3类: 1. 0-1背包, 每个物品只能取0个,或者1个. 2. 完全背包, 每个物品可以取无限次. 3. 多重背包, 每种物品都有个数限制, 第i个物品最多可以为num[i]个.背包问题多用动态规划求解,动态规划...原创 2018-04-15 22:07:22 · 237 阅读 · 0 评论 -
poj 1013 Counterfeit Dollar
DescriptionSally Jones has a dozen Voyageur silver dollars. However, only eleven of the coins are true silver dollars; one coin is counterfeit even though its color and size make it indistinguishable ...原创 2018-04-15 14:58:04 · 127 阅读 · 0 评论 -
poj 1328 Radar Installation
DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, locat...原创 2018-06-30 22:01:50 · 171 阅读 · 0 评论