上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: DescriptionYou 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 in detail how the strings are generated and inserted into the original message. To valid 阅读全文
posted @ 2013-08-19 09:13 WangLC 阅读(200) 评论(0) 推荐(0)
摘要: 题目描述Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave …The bone collector had a big bag with a volume of V ,and along his trip of collecting there are a lot of bones , obv 阅读全文
posted @ 2013-08-17 10:31 WangLC 阅读(236) 评论(0) 推荐(0)
摘要: 题目描述Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1 x 1 or greater located within the whole array. The sum of a rectangle is the sum of all the elements in that rectangle. In this problem the sub-rectangle with the largest sum is 阅读全文
posted @ 2013-08-16 16:22 WangLC 阅读(239) 评论(0) 推荐(0)
摘要: 示例输入25 6 -1 5 4 -77 0 6 -1 1 -6 7 -5示例输出Case 1:14 1 4Case 2:7 1 6 1 #include 2 int main() 3 { 4 int t; 5 scanf("%d",&t); 6 int cases=1; 7 while(t--) 8 { 9 int n,i;10 scanf("%d",&n);11 int sum=0,max=-9999;12 int start=1,end=1,tmp=1;13 int nu... 阅读全文
posted @ 2013-08-16 10:13 WangLC 阅读(186) 评论(0) 推荐(0)
摘要: 示例输入(基本操作数都是一位正整数!)59*684/-3*+#示例输出57 1 #include 2 #include 3 4 struct node 5 { 6 int data; 7 struct node *next; 8 }; 9 10 int main()11 {12 struct node *top,*p;13 int x,y;14 char c;15 top=NULL;16 while((c=getchar())!='#')17 {18 if(c>='0'&&cdata=c-'0';22 ... 阅读全文
posted @ 2013-08-15 09:54 WangLC 阅读(197) 评论(0) 推荐(0)
摘要: 题目描述给定一个无向连通图,顶点编号从0到n-1,用广度优先搜索(BFS)遍历,输出从某个顶点出发的遍历序列。(同一个结点的同层邻接点,节点编号小的优先遍历)输入输入第一行为整数n(0 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 int visited[101]; 9 int n,m,k;10 queueq;11 struct node12 {13 int x,y;14 struct node *next;15 }*head[101];16 17 void add(int x,i... 阅读全文
posted @ 2013-08-13 10:58 WangLC 阅读(381) 评论(0) 推荐(0)
摘要: 题目描述给定一个无向连通图,顶点编号从0到n-1,用广度优先搜索(BFS)遍历,输出从某个顶点出发的遍历序列。(同一个结点的同层邻接点,节点编号小的优先遍历)输入输入第一行为整数n(0 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 int map[105][105]; 9 int visited[105];10 int mark=1;11 int i,root,bian;12 13 queue q;14 15 void bfs(int h,int bian)16 {17 memset(vi... 阅读全文
posted @ 2013-08-12 15:50 WangLC 阅读(737) 评论(0) 推荐(0)
摘要: Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,000) on the same nu 阅读全文
posted @ 2013-08-12 10:16 WangLC 阅读(272) 评论(0) 推荐(0)
摘要: 1 #include 2 #include 3 int main() 4 { 5 char a[170]; 6 int i,j; 7 while(gets(a)&&strcmp(a,"2013")!=0) 8 { 9 i=0;10 while(a[i]!='\0')11 {12 if(a[i]==' ')13 {14 j=i;15 while(a[j]!='\0')16 ... 阅读全文
posted @ 2013-08-10 16:56 WangLC 阅读(167) 评论(0) 推荐(0)
摘要: 大数 题意描述:输入N组数据,计算每一个比该数大并且每位数字之和可被十整除的最小数字,例如202 2+0+2=4,10-4=6,所以208符合题意; 1:若最后一位数字加上补齐的数字之和依然不大于9,就比如202的例子可直接输出加上6的结果208; 2:若大于9则有分为两种情况(1)从第一位一直进到 阅读全文
posted @ 2013-08-10 16:39 WangLC 阅读(606) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 下一页