自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

我辈皆愚

勤能补拙

  • 博客(172)
  • 资源 (3)
  • 收藏
  • 关注

原创 hdu 1540 线段树

链接:http://acm.hdu.edu.cn/showproblem.php?pid=1540题意:有n个点依次链接,先给出三种操作:删除某个点 修复某个点 查询与某个点相连的点的个数解法:主要是query函数的写法。利用回溯,分情况判断左/右是否联通。注意自定义的结构一定要赋初值。  #include iostream>#include s

2012-10-15 20:39:48 735

转载 poj 3468 A Simple Problem with Integers【线段树】

#include #include #include #include #include #include #include #include #include #include #define L(x) (x<<1)#define R(x) (x<<1|1)#define P(x) (x>>1)#define LL long long#define PAUSE sys

2012-07-27 16:43:58 672

原创 hdoj 2795 Billboard 【线段树】

#include #include #include #include #include #include #include #include #include #define L(x) (x<<1)#define R(x) (x<<1|1)#define P(x) (x>>1)#define PAUSE system("pause)using namespace std

2012-07-27 15:14:23 758

原创 hdoj 1698 Just a Hook 【线段树】

#include #include #include #include #include #include #include #include #include #define L(x) (x<<1)#define R(x) (x<<1|1)#define P(x) (x>>1)#define PAUSE system("pause)using namespace std

2012-07-27 15:11:15 875

原创 hdoj 1754 【线段树】

#include #include #include #define LS(x) (x<<1)#define RS(x) (x<<1|1)#define P(x) (x>>1)#define MAXLEN 200005#define PAUSE system("pause")using namespace std;int a[MAXLEN<<2];int n;void bu

2012-07-23 17:29:22 727

原创 hdoj 1166 敌兵布阵 【线段树】

//学习线段树Ing 看的这篇blog :http://www.notonlysuccess.com/index.php/segment-tree-complete/ 稍微改了一下#include #define LSON(x) x<<1#define RSON(x) x<<1|1#define MAXLEN 50005int sum[MAXLEN<<2];int L, R;voi

2012-07-23 15:47:49 758

原创 poj 2227 The Wedding Juicer

乱搞版:#include #include #include #define W 305#define H 305#define B 1000000001#define STOP system("pause")inline int max(int a, int b){ return a > b ? a : b; }inline int min(int a, int b){ r

2012-07-22 00:05:28 1314

原创 黑书 P42 1.3.8 World Final 2002 - G Partition

从网上下的课后习题解答说用floodfill做,但是根本没有思路,根本不知道怎么去floodfill。后来想主要一点就是去掉其中的多余的线段,用递归把图形处理成符合要求的,然后求上确界和下确界就很简单了。处理的过程有很多很多判断,恶心死了,对于‘|’ 分别判断上下两部分,是否符合要求,对于‘_'判断左右中间敲的太快了,把1敲成2了,wa了三次,好纠结

2012-06-07 22:32:21 1151

原创 zoj 1610 Count the Colors【线段树】

//纠结了好久,因为中间的一个逻辑错误#include #include #include #define L(x) ((x) << 1)#define R(x) ((x) << 1 | 1)#define Mid(x, y) (((x)+(y)) >> 1)#define MAX 8005#define P(x) printf(x)#define STOP system("p

2012-04-20 10:38:30 723

原创 系统版本太低..OMG....伤到我了

刚才想在qt中使用SendInput函数,一直提示找不到,进入winuser.h中查看发现前边有一个#if,于是就转用msdn上说已经过时的keybd_event了。据说可以在#include前加上#define _WIN32_WINNT 0x0403解决

2012-02-20 19:47:46 707

原创 hdoj 2199 Can you solve this equation?【二分查找】【水】

OMG。。。刚开始用float wa了,改成double就过了#include double f[100*10000+5];int bsearch(int s, int e, double v){ int m = (s + e) / 2; if(m == s || m == e) return (v - f[s]) < (f[e] - v) ? s : e; e

2012-02-16 23:30:39 1224

原创 hdoj 1864 最大报销额 【DP】【01背包】【水】

题意理解错了,以为是单个物品不能超过600了#include #include #define N 31bool f[30*1000*100+1];int main(){ int flag, n, m, i, j, q, price, sum, pa, pb, pc; char type; float temp; while(scanf("%f%d", &t

2012-02-16 22:53:24 961

原创 hdoj 3466 Proud Merchants 【DP】【01背包】

因为剩余金额会对状态产生影响,所以应该先处理p-q较小的#include #include #include #define N 501#define M 5001typedef struct _node{ int p, q, v;}node;node s[N];int comp(const void *a, const void *b){ int m = ((node*)

2012-02-15 18:55:17 871

原创 hdoj 3496 Watch The Movie【二维背包】【DP】

/*不优化会超时~,OMG。。。*/#include #include #define N 105#define M 105#define L 1005int max(int a, int b){ return a > b ? a : b; }int f[M][L];int main(){ int t, n, m, l, w, v, ans; int i, j, k;

2012-02-15 16:33:51 688

原创 ubuntu 已用命令备份

列出已装软件相关联的文件dpkg -L package 搜索软件某个文件dpkg -L package | grep filename

2012-02-14 19:05:34 783

原创 ubuntu, windows下安装opencv, 以及在qt,vs2010,dev,codeblock中的使用

ubuntu下打开终端,输入 sudo apt-cache search opencv安装sudo apt-get install libcv-dev libcv2.1 libcvaux-dev libcvaux2.1 libhighgui-dev libhighgui2.1 opencv-doc测试代码:#include int main(int argc, char*

2012-02-13 11:14:16 2460 1

原创 ubuntu11.10下自由截图

在windows下一直用的qq截图,在ubuntu下这么搞:系统设置-》键盘-》快捷键-》自定义快捷键-》+-》名称:自由截图, 命令:gnome-screenshot -a ,貌似有一些迟钝。可以在终端中输入gnome-screenshot -?查看帮助,修改成自己喜欢的样子。Gnome-paint和windows下的画图程序类似。http://www.oschina.net/quest

2012-02-02 20:34:14 754

原创 hdoj 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活【DP-多重背包】【水】

#include #include #define MAX 200int f[MAX], v_max;int _max(int a, int b){ return a > b ? a : b;}void ZeroOnePack(int cost, int weight){ for(int v = v_max; v >= cost; v--) f[v] = _max(f[v], f

2012-02-01 20:44:30 1372

原创 hdoj 1059 Dividing【DP-多重背包】

/*145153 2012-02-01 19:49:03 Accepted 3.3.1 218MS 220K 1270B G++ ylwh145151 2012-02-01 19:48:06 Accepted 3.3.1 187MS 220K 1242B G++ ylwh145150 2012-02-01 19:47:03 Pres

2012-02-01 19:53:02 933

原创 hdoj 2571 命运 【DP】【水】

/*很水的dp,不过中间竟然把一个变量写错了,wa了好多次,纠结啊~~*/#include #include const int inf=~0U>>1;inline int max(int a, int b){ return a > b ? a : b;}int main(){ int f[22][1002], temp, t, n, m; scanf("%d",

2012-01-17 16:57:28 897

原创 hdoj 1058 Humble Numbers【dp】

#include int pos[4] = {1, 1, 1, 1};const int flag[4] = {2, 3, 5, 7};int mul[4] = {2, 3, 5, 7};int hum[5845] = {0, 1, 2};inline int getMin()//每次加入数列的数显然都是2,3,5或7乘以一个数,这个数必然要从数列中取,然后取最小值。{ int m

2012-01-17 15:07:17 785

原创 hdoj 2604 Queuing

╮(╯▽╰)╭,不会做,看了别人的blog也不会,根本不知道怎么推出的递推式,后来看到这里有了思路:http://blog.csdn.net/xiaotaoqibao/article/details/5786436原理就是为求f(n)可以由比它短的合法串组成,显然要从与它长度相差最小的几个来找,而且与较短串相加的最短串前两位不能出现f,而且不能重复。

2012-01-15 20:22:14 799

原创 hdoj 2050 折线分割平面【DP】【水】

使折线的夹角尽可能小,这样可以看成一条射线,则最大的情况便是所有射线不平行,对于第n条折线,其一条边与前n-1条边相交可以增加2*(n-1)个区域,这条折线的头部又成一块,所以是2*(n-1)+1+f(n-1)#include int main(){ long long flag[10001] = {0, 2, 7}; for(int i=3; i<10001; i++) fl

2012-01-01 12:46:00 802

原创 hdoj 2044 一只小蜜蜂...【水】

#include int main(){ long long flag[51] = {0, 1, 1}; for(int i=3; i<51; i++){ flag[i] = flag[i-1] + flag[i-2]; } int n, a, b; scanf("%d", &n); while(n--) { scanf("%d%d", &a, &b); printf

2011-12-31 22:14:56 980

原创 hdoj 1133 Buy the Ticket 【DP】【java】【水】

import java.util.Scanner; import java.math.BigInteger; public class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); BigInteger[][] flag = new BigIntege

2011-12-31 21:10:12 912

原创 hdoj 2067 小兔的棋盘【水】【dp】

#include #include #define MAX 40int main(){ long long flag[MAX][MAX]; for(int i=0; i<=35; i++) flag[0][i] = 1; for(int i=1; i<=35; i++) for(int j=1; j<=35; j++) if(i == j) flag[i][j]

2011-12-28 20:35:45 797

原创 hdoj 1134 Game of Connections【水】【java】

import java.util.Scanner;import java.math.BigInteger;import java.math.BigDecimal;public class Main { public static void main(String[] args) { int n=0; BigInteger[] ans = new BigInteger[101]

2011-12-27 03:35:50 930

原创 hdoj 1250 Hat's Fibonacci【java】【水】

import java.util.Scanner;import java.math.BigInteger;import java.math.BigDecimal;public class Main { public static void main(String[] args) { int n=0; BigInteger temp = (new BigDecimal("10E2

2011-12-27 01:07:12 824

原创 hdoj 1997 汉诺塔VII【水】

#include #include /* hanio函数:表示当前的任务是将大小为floor的盘子从from移动到to,当然这个盘子如果在mid(另外一个柱子)上时就证明这不是最优序列,  如果在from上时就可以推出大小为floor-1的盘子的任务是从from移动到mid,如果floor在to上时则floor-1的任务是从mid移动到to上*/int h[3][64], tai

2011-12-26 11:15:42 2539

原创 hdoj 1443 Joseph【水】

#include int main(){ int n; int flag[14] = {0, 2,7,5,30,169,441,1872,7632,1740,93313,459901,1358657,2504881}; while(scanf("%d", &n)!=EOF && n) printf("%d\n", flag[n]); return 0;}刚开始没有打表竟

2011-12-24 00:14:51 910

原创 zoj 2659 Box【水】

#include #include #include using namespace std;#define PLINE printf("-------------\n")class Rect{ public: int x, y; bool operator ==(Rect&b) { if(x == b.x && y == b.y) return true; re

2011-12-06 21:46:43 678

原创 zoj 2187 Blurred Vision【水】【模拟】

#include #include #include #include #include #include #include #define STOP system("pause")using namespace std;int main(){ string s; int n, m, i, j, sum; int e[100][100]; while(true){

2011-12-06 00:50:35 653

原创 hdoj 1286 找新朋友【水】

#include #include #include #include using namespace std;bool flag[32768],staue[32768];inline void makePrime(){ int i, j; for(i=2; i<sqrt(32768); i++) if(flag[i] == true) for(j = i + i;

2011-12-02 01:13:24 1052

原创 hdoj 1717 小数化分数2【水】

/*循环小数化分数:小数形式:循环部分&循环部分 【&】表示连接 分数形式: (非循环部分&循环部分)/( (10^(循环节位数)-1)^(非循环节位数) )例:0.32(692307)32692307 / 99999900 = 17/52 注意的输入:0.00(1) */#include#include #include #include #include #def

2011-12-01 00:04:43 925

原创 zoj 2876 Phone List【字典树】【水】

如果一个号码就是另外一个号码的前缀就输出NO注意应该将号码按照长度升序排序。写的很乱,本来这个代码就不是为了这道题写的。我只是测试一下这种建树的方式对不对#include #include #include #include #define _MAX 1000000#define MAXSON 10#define BASE -'0'using namespac

2011-11-21 23:00:22 753

原创 HDOJ 2087 剪花布条【KMP】

#include #include #include #define MAX 1001int next[MAX];char s[MAX], q[MAX];void getNext(char s[]){ int i, j; j = -1; next[0] = -1; for(i=1; i<strlen(s); i++) { while(j >= 0 && s[j+1] !

2011-11-19 06:43:09 596

原创 HDOJ 2037 今年暑假不AC 【暴力解决】⊙﹏⊙b汗

#include #include using namespace std;#define PLINE printf("\n------------------\n")struct time{ int s,e;}t[101];int n, ans;bool cmp(struct time a, struct time b){ return a.s < b.s;}voi

2011-11-11 11:16:19 691

原创 zoj 2109 FatMouse' Trade【水】

wa了好几次,网上查了一下说是不能对float sort排序...#include #include using namespace std;struct room{ int j, f; //float ave;//去掉}r[1001];int cmp(struct room a, struct room b){ return a.j *

2011-11-11 01:46:24 591

原创 hdoj 2629 Identity Card【操蛋题】

很操蛋的题,月份和日必须用字符串读取和输出,即如果是1月1号的话,输出是01,01,。。。。。#include #include #define P(n) printf(n);break;int main(){ char day[3], mouth[3], s[5]; int n, from, year; scanf("%d", &n); while(n--) { sca

2011-11-09 21:55:03 1417

原创 zoj 1109 Language of FatMouse 【字典树】

#include #include #include struct __TrieNode{ char value; char * word; struct __TrieNode * next; struct __TrieNode * son;};typedef __TrieNode node;char s[100009][11];node m[1000000];int c

2011-11-09 21:04:19 685

qt中配置opencv2.3.1

搞了两天才搞好,适合新手。如果是opencv2.3.1版本的话cmkae后只要把需要的文件copy到D:\QtSDK\OpenCV下,然后直接复制文本中的工程配置就可以了。

2018-04-18

windows下使用opencv2.3.1(qt,dev-c++, codeblocks, vs2010)

全称手写,折腾了好久才全部搞定,为了写教程我又全部重新走了一遍,里边基本上每个过程都有截图,不出意外的话一定能搞好的。压缩包内是个wps文档,需要用WPS打开

2012-02-08

dev-c++配置文件

媛姐的dev配置文件,放到C:\Documents and Settings\Administrator\Application Data\Dev-Cpp下即可

2011-07-21

空空如也

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

TA关注的人

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