题目:http://poj.org/problem?id=2288 不知为什么记忆化搜索就是WA得不得了! #include<iostream> #include<cstdio> #include<cstring> #define ll long long using namespace std; ,Lm=(<<)+; int q,n,m,lm,v[N]; ll ans,prn,dp[Lm][N][N],f[Lm][N][N]; bool b[N][N];
Piegirl found the red button. You have one last chance to change the inevitable end. The circuit under the button consists of n nodes, numbered from 0 to n - 1. In order to deactivate the button, the n nodes must be disarmed in a particular order. No
欧拉回路是指不重复地走过所有路径的回路,而哈密尔顿环是指不重复地走过所有的点,并且最后还能回到起点的回路. 代码如下: #include<iostream> #include<cstring> using namespace std; ; int start,lengt,x,n; bool visited[Maxn],v1[Maxn]; int ans[Maxn],num[Maxn]; int g[Maxn][Maxn]; void print() { int i; ;i<
You've got a undirected graph G, consisting of n nodes. We will consider the nodes of the graph indexed by integers from 1 to n. We know that each node of graph G is connected by edges with at least k other nodes of this graph. Your task is to find i
Walking Race Description flymouse's sister wc is very capable at sports and her favorite event is walking race. Chasing after the championship in an important competition, she comes to a training center to attend a training course. The center has N
Computer Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4440 Accepted Submission(s): 2236 Problem Description A school bought the first computer some time ago(so this computer's id is 1). Du
题目链接: http://poj.org/problem?id=1797 Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his customer has buil
In order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors connecting some rooms. Each time, Wind choose two rooms x and y, and ask one of their little sons go from one to the other. The so
HDU 1069 Monkey and Banana / ZOJ 1093 Monkey and Banana (最长路径) Description A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with
Description Have you ever thought about comparing the weight of fruits? That’s what you should do in this problem! Given a series of fruit weight comparisons, you should anticipate the result of another comparison. In this problem, all fruits of the