摘要: Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = <x1, x2, ..., xm> another sequence Z = <z1, z2, ..., zk> is a subsequence of X if there exists a strictly increasing sequence <i1, i2, ..., ik&g 阅读全文
posted @ 2011-08-04 20:03 kahreman 阅读(354) 评论(0) 推荐(0) 编辑
摘要: Problem Description给你n个整数,请按从大到小的顺序输出其中前m大的数。Input每组测试数据有两行,第一行有两个数n,m(0<n,m<1000000),第二行包含n个各不相同,且都处于区间[-500000,500000]的整数。Output对每组测试数据按从大到小的顺序输出前m大的数。Sample Input5 33 -35 92 213 -644Sample Output213 92 3#include<stdio.h>#include<stdlib.h>#include<time.h>#define N 1000050in 阅读全文
posted @ 2011-08-04 19:47 kahreman 阅读(1362) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionXX星球有很多城市,每个城市之间有一条或多条飞行通道,但是并不是所有的路都是很安全的,每一条路有一个安全系数s,s是在 0 和 1 间的实数(包括0,1),一条从u 到 v 的通道P 的安全度为Safe(P) = s(e1)*s(e2)…*s(ek) e1,e2,ek是P 上的边 ,现在8600 想出去旅游,面对这这么多的路,他想找一条最安全的路。但是8600 的数学不好,想请你帮忙 ^_^Input输入包括多个测试实例,每个实例包括:第一行:n。n表示城市的个数n<=1000;接着是一个n*n的矩阵表示两个城市之间的安全系数,(0可以理解为那两个城 阅读全文
posted @ 2011-08-04 19:39 kahreman 阅读(673) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to regrow. Thus, Farmer John has built a set of drainage ditches so that Bessie's clover 阅读全文
posted @ 2011-08-04 19:31 kahreman 阅读(434) 评论(0) 推荐(0) 编辑