自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 收藏
  • 关注

原创 矩阵连乘 模版

做了一道矩阵连乘模板题。。重新又复习了下....贴下代码:#include #include #include #include #include #include #include #include using namespace std;struct matrix{ int m[3][3];};int n,p;matrix one={

2012-09-24 15:04:25 399

原创 hdu 2112

http://acm.hdu.edu.cn/showproblem.php?pid=2112map加dijkstra的应用吗的开始2B了全部用的map写的,迭代器什么的都用上了,不超时才怪其实把每个地址映射到一个点上就行了,然后dijkstra不过还是WA了,TMD先是题目描述不清,以为是有向图,改了后还是WA崩溃了,静下心来早原来一个判断里面直接conti

2012-09-20 23:12:37 1236

原创 poj 1511

http://poj.org/problem?id=1511最短路问题dijkstra邻接表+优先队列算法正面算一次,反图算一次题目明明说的不超long long全部改成long long 才过代码:#include #include #include #include #include #include #include #include us

2012-09-19 17:28:59 456

原创 hdu 4055

http://acm.hdu.edu.cn/showproblem.php?pid=4055DP.....dp[i][j]表示在第几个数插入数字j的能组成多少种排列如果是‘D’那么dp[i][j]=sum{dp[i-1][x]}(j=如果是‘I’那么dp[i][j]=sum{dp[i-1][x]}(x如果是‘?’那么两者都算这里有个数组sum[i][

2012-09-17 23:22:13 588

转载 位运算学习

去掉最后一位 | (101101->10110) | x >> 1 在最后加一个0 | (101101->1011010) | x << 1 在最后加一个1 | (101101->1011011) | (x << 1) + 1 把最后一位变成1 |

2012-09-16 22:43:43 356

原创 hdu 1556

树状数组 区间应用模版题代码:#include #include #include #include #include #include #include #include using namespace std;int tree[100005];int n;int lowbit(int x){ return x&(-x);}int update(int

2012-09-13 21:01:21 385

原创 hdu 4267

http://acm.hdu.edu.cn/showproblem.php?pid=4267又学到了一点区间更新 单点查值得树状数组代码:#include #include #include #include #include #include #include #include using namespace std;int n;int num[50005

2012-09-13 12:20:27 721

原创 hdu 4268

贪心+数据结构看了题解,研究了一下set,按着题解思路打了一遍#include #include #include #include #include #include #include #include #include using namespace std;struct node{ int height; int width;}alice[10

2012-09-10 23:37:18 384

原创 hdu 4279

http://acm.hdu.edu.cn/showproblem.php?pid=4279按前n个数有多少个real number 打个小表找规律,推公式代码:#include #include #include #include #include #include #include #include #include using namespace std

2012-09-09 23:58:16 526

原创 hdu 4282

http://acm.hdu.edu.cn/showproblem.php?pid=4282太假了,看解题报告说居然只要讨论K==2和K>3就行了2B了贴下代码:#include #include #include #include #include #include #include #include #include using namespace s

2012-09-09 21:01:37 1092

原创 big number poj 1423

哎,用log10函数做在程序内打表,在查表,不会超时,但为什么一边输入一边算会超时啊,两个的最坏的情况不是一样么代码:#include #include #include #include #include #include #include #include using namespace std;int main(){ int T,a; scan

2012-09-06 20:32:30 417

原创 Movie collection

Movie collectionMr. K. I. has a very big movie collection. He has organized his collection in a big stack.Whenever he wants to watch one of the movies, he locates the movie in this stack and remov

2012-09-05 22:16:28 1129

原创 Error Curves

http://acm.hdu.edu.cn/showproblem.php?pid=3714本题用三分搜索法,应该也算简单的三分应用了,正好借这题学了一下三分这里总结一下三分先找到左边界left和右边界right然后取mid=(left+right)/2.0,midmid=(mid+right)/2.0;然后比较mid,midmid然后根据你的图像赋值left或者right

2012-09-05 16:16:43 813

原创 count color

本题是个线段树的题目 听人说也是比较入门的线段树本人新手刚学 不太了解 debug了一天由于对线段树的结构不太了解这里做下总结,有错误的地方望大神们指出,本人新手难免出错,望嘴下留情线段树每次都只能前一半和后一半的区间,并不能包括所有的区间,只有由一个个的不断分成一半一半的区间来组合所有需要的区间在我看来线段树貌似对于有些题目必须要 保持的不间断的区间的问题就有难度了在

2012-09-04 22:58:27 1012

原创 codeforces 136 div2 D题

http://codeforces.com/contest/221/problem/D题意就不说了直接考虑答案的最大情况是:1+2+3+4+......+nn大约得497的样子,这里取500然后就是对于每个输入的数 如果他的数量大于等于他本身 就把他的位置记录下来然后就可以用sum[r]-sum[l-1]得所得数代码:#include #include #inc

2012-09-02 17:42:11 1512

空空如也

空空如也

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

TA关注的人

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