ACM
文章平均质量分 83
FinkyS
finding my own sky
展开
-
POJ - 1276 《Cash Machine》【0-1多重背包】
DescriptionA Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denominat原创 2013-07-21 16:39:47 · 418 阅读 · 0 评论 -
UVA - 11283 《PLAYING BOGGLE》【DFS】
PLAYING BOGGLEBoggle® is a classic word game played on a 4 by 4 grid of letters. The letter grid is randomly generated by shaking 16 cubes labeled with a distribution of letters similar to that fo原创 2013-07-27 23:25:46 · 747 阅读 · 0 评论 -
CodeForces - 329B 《Biridian Forest》 【反向BFS】
Biridian ForestYou're a mikemon breeder currently in the middle of your journey to become a mikemon master. Your current obstacle is go through the infamous Biridian Forest.The forestT原创 2013-07-28 02:04:53 · 571 阅读 · 0 评论 -
LOJ - 1197 - 《Help Hanzo》【区间素数】
1197 - Help HanzoAmakusa, the evil spiritual leader has captured the beautiful princess Nakururu. The reason behind this is he had a little problem with Hanzo Hattori, the best ninja and the love原创 2013-07-27 01:10:16 · 837 阅读 · 0 评论 -
POJ - 1595 《Prime Cuts》
DescriptionA prime number is a counting number (1, 2, 3, ...) that is evenly divisible only by 1 and itself. In this problem you are to write a program that will cut some number of prime numbers f原创 2013-07-26 23:50:59 · 501 阅读 · 0 评论 -
NYOJ - 311 《完全背包》 【完全恰满背包】
描述直接说题意,完全背包定义有N种物品和一个容量为V的背包,每种物品都有无限件可用。第i种物品的体积是c,价值是w。求解将哪些物品装入背包可使这些物品的体积总和不超过背包容量,且价值总和最大。本题要求是背包恰好装满背包时,求出最大价值总和是多少。如果不能恰好装满背包,输出NO输入第一行: N 表示有多少组测试数据(N接下来每组测试数据的第一行有两个整数M,V。 M表原创 2013-07-22 02:47:24 · 359 阅读 · 0 评论 -
SPOJ - 2325 【String Distance】 【dp、剪枝】
DescriptionLet A = a1a2...ak and B = b1b2...bl be strings of lengths k and l, respectively. The string distance between A and B is defined in the following way (d[i,j] is the distance of substring原创 2013-07-22 18:16:26 · 419 阅读 · 0 评论 -
POJ - 2299 Ultra-QuickSort【归并排序】
描述: 求逆序对思路: 归并排序实现代码:#include int is1[500001],is2[500001];long long sum=0;void merge(int low,int mid,int high){ int i=low,j=mid+1,k=low; while(i<=mid&&j<=high) if(is1[i]<=is1[j])原创 2013-07-17 17:05:39 · 494 阅读 · 0 评论 -
POJ - 2325 Persistent Numbers【贪心、高精度】
描述: 给定一个整数M,求一个最小的整数N满足N每位数的乘积等于M。(M的位数不超过1000) 若不存在这样的整数N,则输出"There is no such number.",最后以输入M=-1结束;思路:贪心+高精度Sample Input0147184951768-1Sample Output101114172977原创 2013-07-18 10:12:44 · 593 阅读 · 0 评论 -
POJ - 3624 《Charm Bracelet》 【0-1背包】
DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Each原创 2013-07-20 12:34:08 · 359 阅读 · 0 评论 -
POJ - 1014 《Dividing》 【恰满+多重背包】
DescriptionMarsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles原创 2013-07-21 17:29:33 · 450 阅读 · 0 评论 -
POJ - 1700 Crossing River【贪心】
描述: 求逆序对思路: 归并排序实现代码:#include#includeint cmp(const void *a,const void *b){ return *(int *)a-*(int *)b;}int main(){ int n; scanf("%d",&n); while(n--) { int m原创 2013-07-17 18:57:55 · 271 阅读 · 0 评论 -
POJ - 2479 《Maximum sum》 【线性DP】
Description求一个数列中两个不相交的子段和,要求和最大,输出最大值。InputThe input consists of T(Each test case contains two lines. The first line is an integer n(2OutputPrint exactly one line for each test case原创 2013-07-19 20:18:10 · 372 阅读 · 0 评论