摘要: Sequence题意:给你n*m的矩阵,然后每行取一个元素,组成一个包含n个元素的序列,一共有n^m种序列,让你求出序列和最小的前n个序列的序列和。思路:1.将第一序列读入a向量中,并按升序排序。2.将数据读入b向量中,并按升序排序。 将a[0] + b[i] ( 0 2 #include 3 #include 4 #include 5 using namespace std; 6 7 void Solve() 8 { 9 int a[2010], b[2010];10 int t;11 int n, m;12 priority_queue,less >... 阅读全文
posted @ 2013-12-23 21:33 GLSilence 阅读(182) 评论(0) 推荐(0) 编辑