上一页 1 2 3 4 5 6 7 ··· 15 下一页

2012年3月31日

递归调用

摘要: Image CompressionTime Limit: 1 SecMemory Limit: 128 MBSubmit: 29Solved: 21[Submit][Status][Web Board]DescriptionStrategies for compressing two-dimensional images are often based on finding regions with high similarity. In this problem, we explore a particular approach based on a hierarchical decompo 阅读全文

posted @ 2012-03-31 15:17 Goal 阅读(162) 评论(0) 推荐(0) 编辑

树的直径

摘要: Highway ConstructionTime Limit: 1 SecMemory Limit: 128 MBSubmit: 58Solved: 17[Submit][Status][Web Board]DescriptionAs head of the Accessible Commuting Movement (ACM), you've been lobbying the mayor to build a new highway in your city. Today is your lucky day, because your request was approved. T 阅读全文

posted @ 2012-03-31 10:50 Goal 阅读(196) 评论(0) 推荐(0) 编辑

hoj Simple Computing

摘要: Simple Computing(Edit)Source : ACMGroupTime limit : 1 secMemory limit : 32 MSubmitted : 364, Accepted : 114Given n integers x1 x2 ... xn, you should count how many intergers from 1 to m that can be divided by at least one of them.InputThe first line is an integer c which shows the number of cases. E 阅读全文

posted @ 2012-03-31 10:45 Goal 阅读(137) 评论(0) 推荐(0) 编辑

2012年3月30日

poj 棋盘问题

摘要: 棋盘问题Time Limit: 1000MSMemory Limit: 10000KTotal Submissions: 13899Accepted: 6858Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <= n 当为-1 -1时表示输入结 阅读全文

posted @ 2012-03-30 16:52 Goal 阅读(139) 评论(0) 推荐(0) 编辑

fzu 2077 The tallest tree

摘要: Problem 2077 The tallest tree Accept: 89Submit: 335Time Limit: 1000 mSecMemory Limit : 65536 KB Problem Descriptionlzs种了n棵树,每棵树每天长高一定的高度。某一天,lzs想知道树长得怎么样了,你能求出那一天最高的树有多高吗? Input有 多组测试数据,每组数据第一行输入两个整数n,m(1<=n,m<=100000),接下来n行,每行两个整数a,b(0<=a,b& lt;=100000),表示第i棵树在第0天的高度以及每天生长的高度。接下来m行,每行一 阅读全文

posted @ 2012-03-30 10:32 Goal 阅读(243) 评论(0) 推荐(0) 编辑

2012年3月29日

fzu count

摘要: Problem 2072 Count Accept: 89Submit: 207Time Limit: 1000 mSecMemory Limit : 65536 KB Problem DescriptionGiven an array of positive integers and m queries.Each query contains i, j, x, output the number of occurrences of x into the subarray Ai,Ai+1...,Aj. InputThere are several cases. The first line . 阅读全文

posted @ 2012-03-29 20:04 Goal 阅读(120) 评论(0) 推荐(0) 编辑

2012年3月26日

zjut oj Least Common Multiple

摘要: Least Common MultipleTime Limit:2000MS Memory Limit:32768KDescription:有一个整数序列A[],长度为N,标号为1~N,初始值全部为1。现有两种操作:m i x :给A[i]乘上一个数x。(0 < x < 50)q a b :计算(A[a],A[a+1],...,A[b])的最小公倍数。答案模10007。(a <= b)数据保证A[i]在计算过程中可能会暴long long :)Input:多组数据;每组数据第一行两个整数N和Q,表示序列长度为N,操作数目是Q。(1<=N, Q<=10000). 然 阅读全文

posted @ 2012-03-26 19:51 Goal 阅读(179) 评论(0) 推荐(0) 编辑

2012年3月24日

字典序的最小表示

摘要: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=729就当做模板了#include <iostream>#include <cstdio>using namespace std;const int maxn=500010;char s[maxn];int minxp(int len){ int i=0,j=1,k=0; while(i<len&&j<len&&k<len) { int t=s[(i+k)%len]-s[(j+k)%len]; if(t= 阅读全文

posted @ 2012-03-24 20:23 Goal 阅读(236) 评论(0) 推荐(0) 编辑

预处理dfs

摘要: Shut the BoxTime Limit:5 SecMemory Limit:128 MBSubmit:9Solved:5[Submit][Status][Web Board]DescriptionShut the Box is a one-player game that begins with a set ofNpieces labeled from 1 toN. All pieces are initially "unmarked" (in the picture above, the unmarked pieces are those in an upward 阅读全文

posted @ 2012-03-24 17:09 Goal 阅读(232) 评论(1) 推荐(0) 编辑

状态压缩dp

摘要: Figure 1Figure 2A police unit has dealt with a number of situations where they need to search multiple sites as rapidly as possible with a small group of officers. Figures 1 and 2 are diagrams for two situations. Sites to search are labeled with capital letters. The site labeled A is the common star 阅读全文

posted @ 2012-03-24 14:08 Goal 阅读(374) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 ··· 15 下一页

导航