Saruman's Army
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 3519
Accepted: 1787
Description
Saruman the White must lead his army along a straight path...
分类:
其他好文 时间:
2014-05-22 10:09:49
阅读次数:
271
题目链接:poj 2411 Mondriaan's Dream
题目大意:用1?2的木块填满n?m的矩阵有多少种方法。
解题思路:插头dp裸题。uva11270
#include
#include
typedef long long ll;
const int N = 13;
int n, m;
ll set, dp[N+5][(15];
void solve (int d,...
分类:
其他好文 时间:
2014-05-22 08:06:07
阅读次数:
177
Fence Repair
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 24153
Accepted: 7703
Description
Farmer John wants to repair a small length of the fence aroun...
分类:
其他好文 时间:
2014-05-22 07:55:44
阅读次数:
255
ExpeditionTime Limit: 1000MSMemory Limit: 65536KDescriptionA group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately manag...
分类:
其他好文 时间:
2014-05-22 06:16:01
阅读次数:
423
题目:http://poj.org/problem?id=1141转载:http://blog.csdn.net/lijiecsu/article/details/7589877定义合法的括号序列如下:1
空序列是一个合法的序列2 如果S是合法的序列,则(S)和[S]也是合法的序列3 如果A和B是合...
分类:
其他好文 时间:
2014-05-22 02:52:11
阅读次数:
256
大体题意: 先输入试验次数num,再输入三个字符串A,B,C,判断C可否由A,B按照某种次序组成。如下图。
#include
#include
using namespace std;
#define MAX_SIZE 205
char A[MAX_SIZE];
char B[MAX_SIZE];
char C[2 * MAX_SIZE];
bool...
分类:
其他好文 时间:
2014-05-21 16:05:09
阅读次数:
209
Description
Facer's pet cat just gave birth to a brood of little cats. Having considered the health of those lovely cats, Facer decides to make the cats to do some exercises. Facer has well designe...
分类:
其他好文 时间:
2014-05-21 10:36:57
阅读次数:
297
SOL : 扩展的欧几里德, ax+by==c
x=x0+b/d*t;
y=y0-a/d*t;
求|x|+|Y|的最小值
可以发现:
|x0+b/d*t| 单调递增 |y0-a/d*t| 单调递减
因为 a>b,所以就是说函数是凹的,先减小后增大。
显然 当y0-a/d*t==0的时候 |x|+|Y| 最小值就在那附近。
枚举几个值就能找到。
#in...
分类:
其他好文 时间:
2014-05-21 09:25:41
阅读次数:
290
题意:现在有一群人,告诉你每个人都认识哪些人,让你将这一群人分成两组,其中每一组中的每个人都相互认识,并且使得两组中的人数尽量相近。问你是否能分成这样两组,如果不能输出No
Solution ,否则输出人数最相近的方案。 注意你认识我不代表我认识你,组中的每一个人都必须是相互认识的。 首先建立由人和...
分类:
其他好文 时间:
2014-05-21 05:04:15
阅读次数:
306
DescriptionA rooted tree is a well-known data
structure in computer science and engineering. An example is shown below:In the
figure, each node is lab...
分类:
其他好文 时间:
2014-05-21 03:23:51
阅读次数:
296