摘要: Problem DescriptionSome of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, the puzzle is very important for us.There is a large number of magnetic plates on every door. Every plat 阅读全文
posted @ 2013-08-11 19:50 默默如潮 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 并查集是一种很方便实现也很有效的数据结构,应用也十分的广泛,主要包括两个操作,合并与查询,当然还有很多的变形。一、先来很裸的并查集:uva1160 - X-PlosivesX-PlosivesA secret service developed a new kind of explosive that attain its volatile property only when a specific association of products occurs. Each product is a mix of two different simple compounds, to which 阅读全文
posted @ 2013-08-11 10:37 默默如潮 阅读(437) 评论(0) 推荐(0) 编辑
摘要: A company offers personal computers for sale in N towns (3 2 #include 3 #include 4 #include 5 #define maxlen 40 6 using namespace std; 7 int maps[maxlen][maxlen]; 8 int s[maxlen]; 9 int visited[maxlen];10 int ans;11 int n,m;12 bool cmp(int a,int b)13 {14 return a>b;15 }16 void dfs(int v,int ... 阅读全文
posted @ 2013-08-08 11:33 默默如潮 阅读(584) 评论(0) 推荐(0) 编辑
摘要: Oil DepositsThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land into numerous square plots. It then analyzes each plot separately, using sensing. 阅读全文
posted @ 2013-08-01 20:52 默默如潮 阅读(332) 评论(1) 推荐(0) 编辑
摘要: 来补解题报告。Problem A: 【C语言训练】求具有abcd=(ab+cd)^2性质的四位数Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 37 Solved: 37[Submit][Status][Web Board]Description3025这个数具有一种独特的性质:将它平分为二段,即30和25,使之相加后求平方,即(30+25)2,恰好等于3025本身。请求出具有这样性质的全部四位数InputOutput满足题意的数全部四位数(从小到大输出,且数之间用两个空格分开) Sample InputSample Output2025 30... 阅读全文
posted @ 2013-07-30 22:01 默默如潮 阅读(861) 评论(0) 推荐(0) 编辑
摘要: Problem A (hdu 1086)You can Solve a Geometry Problem tooTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5559Accepted Submission(s): 2660Problem DescriptionMany geometry(几何)problems were designed in the ACM/ICPC. And now, I also prepare a geometry p 阅读全文
posted @ 2013-07-18 23:29 默默如潮 阅读(399) 评论(0) 推荐(0) 编辑
摘要: Problem A (hdu 1261)Time Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 71Accepted Submission(s) : 14Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem Description一个A和两个B一共可以组成三种字符串:"ABB","BAB","BBA".给定若干字母和它们相应的个数,计算一 阅读全文
posted @ 2013-07-18 22:54 默默如潮 阅读(454) 评论(0) 推荐(0) 编辑
摘要: Problem A: 【C语言训练】字符串正反连接Time Limit:1 SecMemory Limit:128 MBSubmit:78Solved:41[Submit][Status][Web Board]Description所给字符串正序和反序连接,形成新串并输出Input任意字符串(长度 2 #include 3 #include 4 #define maxlen 1100 5 using namespace std; 6 char str[maxlen]; 7 int main () 8 { 9 while(gets(str))10 {11 in... 阅读全文
posted @ 2013-07-16 13:07 默默如潮 阅读(693) 评论(0) 推荐(0) 编辑
摘要: Problem A: 神奇的fansTime Limit:1 SecMemory Limit:128 MBSubmit:84Solved:30[Submit][Status][Web Board]Description传说fans是一个数学天才。在他五岁那年,从一堆数字卡片中选出了4张 卡片:5,7,6,8。这4个数字有什么神秘之处呢?如果把这4张卡片自左往右的排成:5,6,7,8。你就会发现:原来这4个数字构成了等差数列!当年 fans选出了n组卡片,据说都能够构成等差数列。但是事实真的是这样吗?fans真的有这么神奇吗? n组数据就是fans选出的n组卡片,请你判断每一组卡片是否能构成等差 阅读全文
posted @ 2013-07-14 22:35 默默如潮 阅读(1259) 评论(2) 推荐(1) 编辑
摘要: Problem EAll in AllInput:standard inputOutput:standard outputTime Limit:2 secondsMemory Limit:32 MBYou have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. Because of pending patent issues we will not discuss 阅读全文
posted @ 2013-07-13 18:55 默默如潮 阅读(206) 评论(0) 推荐(0) 编辑