自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 HDOJ 2451 Simple Addition Expression

<br />这题模拟比较麻烦,所以贴了上来,代码没有优化。<br />#include<iostream> #include<math.h> using namespace std; const int Size=15; char ch[Size]; int n[Size]; int cnt[Size]; int num[11]={0,3,12,48,192,768,3072,12288,49152,196608,786432}; int l; void init(){ int i;

2011-05-29 16:26:00 187

转载 C++ qsort用法

一、对int类型数组排序int num[100]; Sample: int cmp ( const void *a , const void *b ) { return *(int *)a - *(int *)b; } qsort(num,100,sizeof(num[0]),cmp);二、对char类型数组排序(同int类型)char word[100]; Sample: int cmp( const void *a , const void *b ) { return *(char

2011-05-11 17:25:00 7425

转载 C++ priority_queue

<br /> <br />如果要用到小顶堆,则一般要把模板的三个参数都带进去。<br /> STL里面定义了一个仿函数 greater<class T>,less<class T>,对于基本类型可以用这个仿函数声明小顶堆<br />例子:<br />priority_queue<int, vector<int>, greater<int> > q; <br />对于自定义类型,则必须自己重载 operator< 或者自己写仿函数<br />先看看例子:<br />struct Node{ int

2011-05-11 17:06:00 201

原创 HDOJ HDU 3080

注意带*的行就差不多了,应该就没问题了,Prim#include using namespace std; const int N=300; const int inf=999999999; int arc[N][N]; bool f[N]; int M[N]; int MaxV,m; void Destroy(){ int i,j; for(i=0;i

2011-05-10 18:01:00 213

空空如也

空空如也

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

TA关注的人

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