上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 40 下一页

2013年6月15日

MUTC 3 D - Cut the cake 最大子矩阵

摘要: Cut the cakeTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 835Accepted Submission(s): 308Problem DescriptionMark bought a huge cake, because his friend ray_sun’s birthday is coming. Mark is worried about how to divide the cake since it’s so huge a 阅读全文

posted @ 2013-06-15 11:51 电子幼体 阅读(164) 评论(0) 推荐(0) 编辑

UVa 1330 - City Game 最大子矩阵

摘要: Bob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by areas, in which there are streets, trees, factories and buildings. There is still some space in the area that is unoccupied. The strategic task of his game is to w 阅读全文

posted @ 2013-06-15 10:59 电子幼体 阅读(142) 评论(0) 推荐(0) 编辑

扫描线法求最大子矩阵

摘要: 问题描述:给定一个N*M的矩阵,其中有一些格子是空地,其他是障碍。找出一个全部由空地组成的面积/周长最大的子矩阵。朴素算法:枚举左上角的坐标O(mn)和右下角的坐标O(mn),判断是否全为空地O(mn),时间复杂度为O(m3*n3)。扫描线法:把点(i,j)向上所有连续的空格看做一条悬线。矩阵中的每个点都向上对应了一条悬线。①用h[i,j]表示点(i,j)对应的悬线长度。当(i,j)为障碍时,h[i,j]=0;当(i,j)为空格时,h[i,j]=h[i-1,j]+1。②用left[i,j]表示点(i,j)对应的悬线的左边界。当(i,j)为障碍时,left[i,j]=左边界;当(i,j)为空格时 阅读全文

posted @ 2013-06-15 09:58 电子幼体 阅读(239) 评论(0) 推荐(0) 编辑

2013年6月14日

[置顶] 挑战编程

摘要: 第一章 入门Chapter 1100-The 3n + 1 problem#include #include #include using namespace std; const int maxn=1111111; int f[maxn]; int main() { int x,y; int ans,ret; memset(f,0,sizeof(f)); while (~scanf("%d%d",&x,&y)) { ans=0; for (int i=min(x,y);ians) ans=ret; ... 阅读全文

posted @ 2013-06-14 11:45 电子幼体 阅读(104) 评论(0) 推荐(0) 编辑

挑战编程

摘要: 第一章 入门Chapter 1100-The 3n + 1 problem#include #include #include using namespace std;const int maxn=1111111;int f[maxn];int main(){ int x,y; int ans,ret; memset(f,0,sizeof(f)); while (~scanf("%d%d",&x,&y)) { ans=0; for (int i=min(x,y);ians) ans=ret; } printf... 阅读全文

posted @ 2013-06-14 11:45 电子幼体 阅读(170) 评论(0) 推荐(0) 编辑

2013年6月13日

MUTC 3 D - Magic Number DP

摘要: Magic NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1113Accepted Submission(s): 480Problem DescriptionThere are many magic numbers whose lengths are less than 10. Given some queries, each contains a single number, if the Levenshtein distanc 阅读全文

posted @ 2013-06-13 10:49 电子幼体 阅读(176) 评论(0) 推荐(0) 编辑

2013年6月12日

MUTC 3 E - Triangle LOVE 图论/搜索

摘要: Triangle LOVETime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1629Accepted Submission(s): 693Problem DescriptionRecently, scientists find that there is love between any of two people. For example, between A and B, if A don’t love B, then B must love 阅读全文

posted @ 2013-06-12 13:38 电子幼体 阅读(147) 评论(0) 推荐(0) 编辑

2013年6月7日

戴牛一万行的几何模板

摘要: #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define mp make_pair #define pb push_back using namespace 阅读全文

posted @ 2013-06-07 18:21 电子幼体 阅读(126) 评论(0) 推荐(0) 编辑

哈希模板

摘要: #include #include using namespace std; const int maxn=11111; const int maxh=10000019; int head[maxh]; int next[maxh]; long long st[maxn]; void hash_init() { memset(head,0,sizeof(head)); } int hash(long long p,int prime=10000019) { int h; //hash操作 h=p%prime; return h; } boo... 阅读全文

posted @ 2013-06-07 10:20 电子幼体 阅读(141) 评论(0) 推荐(0) 编辑

2013年6月6日

UVa 10391 - Compound Words 字符串hash

摘要: Problem E: Compound WordsYou are to find all the two-word compound words in a dictionary. A two-word compound word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary.InputStandard input consists of a number of lowercase words, one per line, in alphabet 阅读全文

posted @ 2013-06-06 18:14 电子幼体 阅读(152) 评论(0) 推荐(0) 编辑

上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 40 下一页

导航