自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(17)
  • 收藏
  • 关注

原创 [HDU 4277](长春 1011 )搜索+剪枝

不能过于偏向于队友,应该相信自己的判断。这么简单的搜索题目竟然被搞的如此2B。。。 3^15的搜索剪剪枝可以想想,4^15的就不用思考了。。。 直接枚举放在哪个上面,并且a #include #include #include using namespace std; int a[20],z[20],n,sum[3],ans, SUM; #define LL __int64 str

2012-09-13 02:12:15 327

原创 [HDU 4268](长春Online 1002) set+map + 贪心

#include #include #include #include #include #include using namespace std; map Meng; set zhu; const int N = 200000; struct Men{ int l,r; bool operator < (const Men & A) const{ if

2012-09-13 01:54:42 359

原创 [HDU 4267](长春1001) 正式可以手写线段树了

跟孟神混,向着金牌! 方法一: 开55棵线段树 方法二: 线段树55个Node。 Attation: 1、线段树传Struct TLE 2、开55*50000*2 MLE 3、多点更新单点求值不用PushUp #include #include #include #include #include using namespace std; #define lson l ,

2012-09-13 01:41:34 379

原创 [SCSE-ACMer 第一季训练计划]

资料: http://baike.baidu.com/view/2455255.htm http://www.matrix67.com/blog/archives/276   题目: http://acm.hdu.edu.cn/webcontest/contest_show.php?cid=1361     来源:

2012-01-25 20:11:17 406

原创 貌似是对的。哈夫曼树的路径长度——堆优化

/*【问题描述】已知输入一串正整数,正整数之间用空格键分开,请建立一个哈夫曼树,以输入的数字为叶节点,求这棵哈夫曼树的带权路径长度。【输入形式】首先输入正整数的个数,然后接下来为接下来的正整数,正整数个数不超过10个【输出形式】输出相应的权值【样例输入】5 4 5 6 7 8【样例输出】69*/#include #include typedef struct Node {

2011-11-15 19:32:46 1843 1

原创 未经验证的堆 C 代码,求验证

rt #include #include int len; int heap[20]; void swap(int *a,int *b) { int tmp=*a; *a=*b; *b=tmp; } void push_heap(int *heap,int s) { heap[++len]=s; int t=len;

2011-11-15 19:15:08 295

原创 【POJ 1084】 很烦人的DLX

DLX。。。 一开始读错题目了。。。是要把所有正方形都消掉!!! 代码里面有两种统计正方形和火柴的方法,都值得借鉴。。Orz 发一下代码   #include #include #include #include using name

2011-10-14 20:02:31 1316

原创 [HDU 4069]刷的水DLX

终于过了。。。要记住 记解,解可能被覆盖 memO的故事。。。 题意:求  一行+一列+不规则图形 满足数独的解 原题: Squiggly Sudoku Time Limit: 4000/2000 MS (Java/Others)    Memory Limit:

2011-10-11 22:49:08 491

原创 一个更强大的高精度

这个是从http://blog.csdn.net/cclsoft/article/details/5468865这里淘来的 这个直接采用二进制 效率很高 而且也可以用来转换进制 还有素数测试功能 我的那个就无视掉吧。。用这个吧就 #include #include #inc

2011-08-14 15:04:59 433

原创 【HDU 1864】 最大报销额 DP+剪枝+非递归dfs

题意:    一堆发票,找出:      1、只有 ABC 类型销售的      2、每一种销售类型(题意不清)A B C 不能超过600元      3、每张发票总金额不超过1000元   在金额m之下的最大金额 #include #include #inclu

2011-08-12 20:49:51 412

原创 高精度。。

高精度类。。可进行有符号加减乘除取余。。以及+-*/%>==> #define refcnt(a) while((a).cells[(a).ccount]==0&&(a).ccount>0)(a).ccount--; const int cellcount=1100,cellw

2011-08-08 19:48:12 301

转载 【HDU 3909】变种Sudoku 拿个漂亮的当模板吧——dancingLinkx

对于N=2,3,4 分别对于4*4,9*9,16*16的4进制、9进制、16进制 #include #include #include #include #include #include #include #include #include #define

2011-08-03 13:12:02 364

原创 【POJ 1964】求10图矩形最大面积

星爷代码: 思想——维护左上角的单调栈 #include #include #include using namespace std; int main(){ int casenum; cin >> casenum; while (casen

2011-08-01 16:25:52 317

原创 【POJ 1656】 水题,不过抄了个二维线段树的代码

#include #include #include int num[2000001], cover[2000001]; void push(int idx, int lx, int rx, int ly, int ry) { if (cover[idx] == -1)

2011-08-01 16:22:39 494

原创 【POJ 2960】SG函数

#include<iostream> #include <stdio.h> #include <string.h> #include <algorithm> using namespace std; const int NN=10010; int q,l,n; int take[

2011-08-01 13:31:27 476

原创 离散化模版

template struct line { T a,b; }; template struct helper { T v;//原值 int index;//原值的位置 static int cmp(const void*a,const void*b) { T r=

2011-07-31 22:25:33 357

原创 第一篇..poj3468 线段树解法

之前这道题用树状数组水过的,但是用线段树一直wa或者tle,昨天终于AC了。。贴一下,binsec结构可当模版. #include #include #include #include using namespace std; const int M=131072;

2011-07-31 22:10:31 286

空空如也

空空如也

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

TA关注的人

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