摘要:
Problem DescriptionThe 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 s 阅读全文
摘要:
Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗?Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1 #include #include using namespace std;int num[102][102];int dp[102][102];int main(){ int t,ti,n; cin>>t; for(ti=1;ti>n; 阅读全文
摘要:
Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( #include using namespace std;struct Node{ int u,v; int len;}node[5000]; //每条边是一个结构体,u,v分别为边两头的点,len为边的长度int parent[103... 阅读全文
摘要:
Problem DescriptionThere is a hill with n holes around. The holes are signed from 0 to n-1.A rabbit must hide in one of the holes. A wolf searches the rabbit in anticlockwise order. The first hole he get into is the one signed with 0. Then he will get into the hole every m holes. For example, m=2 an 阅读全文
摘要:
PerfectionTime Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 11Accepted Submission(s) : 6Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem DescriptionFrom the article Number Theory in the 1994 Microsoft Encarta: "If a, b, c are integers such 阅读全文
摘要:
Eddy's digital RootsTime Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 11Accepted Submission(s) : 7Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem DescriptionThe digital root of a positive integer is found by summing the digits of the integ 阅读全文
摘要:
A hard puzzleTime Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 25Accepted Submission(s) : 7Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem Descriptionlcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how to know the 阅读全文
摘要:
最简单的计算机Time Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 10Accepted Submission(s) : 7Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem Description一个名叫是PigHeadThree的研究组织设计了一台实验用的计算机,命名为PpMm。PpMm只能执行简单的六种命令A,B,C,D,E,F;只有二个内存M1,M2;三个寄存器R1,R2,R3。六种命 阅读全文
摘要:
#include #include #include using namespace std;struct node{ int x; int y;};int cmp(const void *a,const void *b){ return *(int *)a-*(int *)b;}//从小到大排bool comp(int a,int b){ if(a<b) return true; return false;}//从小到大排bool cmpp(node a,node b){ if(a.x<b.x) return true; ... 阅读全文
摘要:
最少拦截系统Time Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 75Accepted Submission(s) : 27Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem Description某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由 阅读全文