摘要: 最短距离的两点 Time Limit:1000MS Memory Limit:32768KDescription:给出一些整数对,它们表示平面上的点,求所有这些点中距离最近的两个点。结构为:每组数据的第一行只有一个整数N,表示后面有N个点。求这些点中的两点,以表明该两点是所有点中距离最短的。若N为0,则表示输入结束。Sample Input:Sample Output://用二维数组实现#incl... 阅读全文
posted @ 2010-04-17 22:42 蓝牙 阅读(1194) 评论(0) 推荐(0) 编辑
摘要: 文件名查找 Time Limit:1000MS Memory Limit:32768KDescription:在目录里用搜索查找文件是很方便的但是这究竟是怎样一个过程呢?Input:第一行为2个整数n,m(0<n,m<=10) 接着有n行字串每行包含数据Ni,表示文件名(无空格) 后面是m行查询每行包含数据Si,表示要查询的文件名前缀Output:对于每个查询,输出以Si为前缀的文件总... 阅读全文
posted @ 2010-04-17 21:26 蓝牙 阅读(345) 评论(0) 推荐(0) 编辑
摘要: #include "algostuff.hpp"using namespace std;void printCollection(const list<int>& l){PRINT_ELEMENTS(l);}bool lessForCollection(const list<int>& l1,const list<int>& l2){ r... 阅读全文
posted @ 2010-04-17 20:45 蓝牙 阅读(933) 评论(0) 推荐(0) 编辑
摘要: #include "algostuff.hpp"using namespace std;int main(){vector<int> coll1;list<int> coll2;INSERT_ELEMENTS(coll1,1,6);for(int i=1;i<=16;i*=2){coll2.push_back(i);}coll2.push_back(3);PRINT_... 阅读全文
posted @ 2010-04-17 20:25 蓝牙 阅读(316) 评论(0) 推荐(0) 编辑
摘要: #include "algostuff.hpp"using namespace std;bool doubled(int elem1,int elem2){return elem1*2==elem2;}int main(){vector<int> coll;coll.push_back(1);coll.push_back(3);coll.push_back(2);coll.push_b... 阅读全文
posted @ 2010-04-17 20:04 蓝牙 阅读(174) 评论(0) 推荐(0) 编辑
摘要: #include "algostuff.hpp"using namespace std;int main(){vector<int> coll;list<int>searchcoll;INSERT_ELEMENTS(coll,1,11);INSERT_ELEMENTS(searchcoll,3,5);PRINT_ELEMENTS(coll,"coll: ");PRINT_E... 阅读全文
posted @ 2010-04-17 19:50 蓝牙 阅读(490) 评论(0) 推荐(0) 编辑