2009年2月28日

POJ2140

摘要: 取m为第一个数 组合个数 所组成的数 1 m 2 m m+1 3 m m+1 m+2 4 m m+1 m+2 m+3 5 m m+1 m+2 m+3 m+4 可以求m为:(2*n - t^2 + t)/(2*t) (t = 1,2,3...),只要求的m合法即可 Code highlighting produ... 阅读全文

posted @ 2009-02-28 21:14 Xredman 阅读(298) 评论(0) 推荐(0) 编辑

ZOJ1331

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include #include using namespace std; const int MAX_SIZE = 202; int Cube[MAX_SIZE]; int cmp(cons... 阅读全文

posted @ 2009-02-28 16:41 Xredman 阅读(227) 评论(0) 推荐(0) 编辑

bsearch()实现二分查找(转)

摘要: C语言中可以用bsearch()实现二分查找。同qsort()一样,bsearch()也包含在库中,且同样要 自定义比较子函数。其原型如下: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->void *bsearch(const void *... 阅读全文

posted @ 2009-02-28 15:18 Xredman 阅读(246) 评论(0) 推荐(0) 编辑

ZOJ1292

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include #include #include using namespace std; const int MAX_SIZE = 105; int Result[MAX_SIZE]; i... 阅读全文

posted @ 2009-02-28 14:58 Xredman 阅读(321) 评论(0) 推荐(0) 编辑

POJ1949

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include using namespace std; const int MAX_SIZE = 52; int height[MAX_SIZE]; int main() { int... 阅读全文

posted @ 2009-02-28 14:23 Xredman 阅读(191) 评论(0) 推荐(0) 编辑

导航