自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 资源 (2)
  • 收藏
  • 关注

原创 hdu 1394 Minimum Inversion Number(优化版)

<br />使用线段树优化使得求初始数列的逆序数的时间复杂度从O(n ^ 2) 降到 O(n log(n))<br />/* Author: ACb0y Date: 2010年11月16日14:59:06 Type: math ProblemId: hdu 1394 Minimum Inversion Number Result: 3201273 2010-11-16 14:55:27 Accepted 1394 62MS 380K 1741 B G++ ACb0y 备注:本题使用

2010-11-16 15:12:00 902

原创 hdu 1394 Minimum Inversion Number(未优化版)

<br />未优化版本时间复杂度为O(n^2)主要是在求初始数列的逆序数值。<br />#include <iostream> using namespace std; int data[5005]; int main() { int i, j; int n; while (scanf("%d", &n) != EOF) { for (i = 0; i < n; ++i) { scanf("%d", &data[

2010-11-16 15:10:00 596

原创 hdu 1131 Count the Trees(catalan数的应用)

<br />catalan数<br />/* Author: ACb0y Date: 2010年11月13日17:16:51 Type: catalan数的应用 递推公式为:C( n ) = n * (4*n - 2)* C(n - 1)/(n + 1); ProblemId: hdu 1131 Count the Trees Result: 3190360 2010-11-13 17:13:59 Accepted 1131 0MS 588K 1123 B G++ ACb0y */

2010-11-13 17:25:00 1581

原创 hdu 1198 Farm Irrigation(并查集)

<br />本题考察的知识点是并查集,解决问题的关键是写出水管连通判断表,剩下来的就是对并查集操作的考察。<br />/* Author: ACb0y Date: 2010年11月13日15:20:47 Type:union set ProblemId: hdu 1198 Farm Irrigation Result: 3189494 2010-11-13 15:19:27 Accepted 1198 15MS 340K 3375 B G++ ACb0y */ #include <i

2010-11-13 15:24:00 1102

原创 hdu 1023 Train Problem II(catalan数)

<br />catalan数的简单应用: h(n) = ((4 * n - 2) * h(n - 1) / (n + 1)<br />/* Author: ACb0y Date: 2010-11-12 Type: 这道题是简单的卡特兰数,满足递推公式h(n)=(4*n-2)*h(n-1)/(n+1); ProblemId: hdu 1023 Train Problem II Result: 3184349 2010-11-12 16:29:17 Accepted 1023 0MS 352

2010-11-12 16:33:00 900

原创 hdu 1258 Sum It Up(回溯算法)

<br />题意:从给定的n个正整数中选出m个数(m <= n)使得这m个数的和为给定的total<br />解法:回溯<br />/* Author: ACb0y Date: 2010-11-11 ProblemId: hdu 1258 Sum It Up Result: 3181578 2010-11-11 20:42:18 Accepted 1258 0MS 368K 1461 B G++ ACb0y */ #include <iostream> #include <algori

2010-11-11 20:47:00 1412

原创 Uva 621 Secret Research

<br />/* Author: ACb0y Date: 2010-11-8 Type: Water~~ ProblemId: Uva 621 Secret Research Result: 8382071 621 Secret Research Accepted C++ 0.012 2010-11-08 08:08:34 */ #include <iostream> using namespace std; //定义一个函数指针类型 typedef bool (*fun)(s

2010-11-08 16:27:00 936

原创 UVa 123 Searching Quickly

水题不解释/* Author: ACb0y Date: 2010-11-8 Type: water~~ ProblemId: UVa 123 Searching Quickly Result: 8381985 123 Searching Quickly Accepted C++ 0.020 2010-11-08 07:06:11 */ #include #include #include #include #include #include using nam

2010-11-08 15:22:00 1138

高精度加减乘除模运算

高精度加减乘除模运算很好的封装在一个类中,还有完整的注释,绝对物有所值。

2010-03-13

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除