Peng Lv

毋意,毋必,毋固,毋我。 言必行,行必果。

导航

上一页 1 2 3 4 5 6 7 8 ··· 13 下一页

2012年5月23日 #

[ReShip] Linux Shell 字符串操作

摘要: ===================================================================== This article came from here. Thanks to chengmo=====================================================================在做shell批处理程序时候,经常会涉及到字符串相关操作。有很多命令语句,如:awk,sed都可以做字符串各种操作。 其实shell内置一系列操作符号,可以达到类似效果,大家知道,使用内部操作符会省略启动外部程序等时间,因此速.. 阅读全文

posted @ 2012-05-23 18:39 Lvpengms 阅读(311) 评论(0) 推荐(0) 编辑

[Keep Updating] Matlab Notes

摘要: # select a rectangle from an frame[l r t b ] = select(iFrame);# import data from a data fileinfo = importdata('info.txt')# Read image to a Cell structfor i = 1:N F{i} = imread(img_i);end# Create an struct/classst = struct('name','lp','id',7,'age',22);# use a f 阅读全文

posted @ 2012-05-23 15:50 Lvpengms 阅读(277) 评论(0) 推荐(0) 编辑

2012年5月20日 #

{HDU}{4221}{Greedy}{Greedy}

摘要: 贪心处理,关键是寻找题意中隐含的条件,并且证明贪心算法的正确性。输出一定用"%I64d"而不是"%lld"!#include <iostream>#include <string>#include <cstring>#include <cstdio>#include <algorithm>#include <memory>#include <cmath>#include <bitset>#include <queue>#include <ve 阅读全文

posted @ 2012-05-20 01:13 Lvpengms 阅读(304) 评论(0) 推荐(0) 编辑

{HDU}{4217}{Data Structure}{树状数组or线段树}

摘要: 思路:在给定的序列中一次那周第Ki小的数,求和。这题用线段树很容易就AC我用的是树状数组,中间涉及到一个二分查找的过程,出了太多错误了,这个题WA成狗了。。。(1)二分中求最左的数(2)树状数组的初始化本题很特殊。。。#include <iostream>#include <string>#include <cstring>#include <cstdio>#include <algorithm>#include <memory>#include <cmath>#include <bitset>#i 阅读全文

posted @ 2012-05-20 00:04 Lvpengms 阅读(301) 评论(0) 推荐(0) 编辑

2012年5月19日 #

{POJ}{4000}{National Treasures}{二分匹配}

摘要: 思路:观察宝物周围的keypoints与宝物位置的距离是奇数,也就转化成为染色问题,将图进行染色,黑色与白色之间构成二分图,求最小边覆盖即可。一道经典的染色转化问题。#include <iostream>#include <string>#include <cstring>#include <cstdio>#include <algorithm>#include <memory>#include <cmath>#include <bitset>#include <queue>#inclu 阅读全文

posted @ 2012-05-19 14:02 Lvpengms 阅读(624) 评论(0) 推荐(1) 编辑

2012年5月17日 #

{POJ}{2421}{Constructing Roads}{Prim}

摘要: 基本MST思路#include<iostream>using namespace std;#define MAX 10000#define INF 999999int g[MAX][MAX],visit[MAX],dist[MAX];int nv,ne,sum;int prim(){ int i,j,tmp,mark_pos,mark_min; sum = 0; for(i = 1;i<=nv;++i) { dist[i] = INF; visit[i] = 0; } dist[1] = 0; for(i=1;i<=nv;++i) { mark_min = INF; f 阅读全文

posted @ 2012-05-17 09:45 Lvpengms 阅读(262) 评论(0) 推荐(0) 编辑

2012年5月16日 #

{HDU}{4082}{Hou Yi's secret}{几何}

摘要: 11年北京赛区的B题,数据量很小暴力搜索的计算几何,但是有很多小地方需要注意,WA了N次:注意对点判重,否则乎会生成很多一样的三角形三个点在同一条直线上的情况判断相似性的时候不需要判断角度,只需要对边进行比例判定即可#include <iostream>#include <string>#include <cstring>#include <cstdio>#include <algorithm>#include <memory>#include <cmath>#include <bitset>#in 阅读全文

posted @ 2012-05-16 21:06 Lvpengms 阅读(395) 评论(0) 推荐(0) 编辑

{HDU}{4190}{Distributing Ballot Boxes}{二分答案}

摘要: 二分答案与箱子数目进行匹配判定。#include <iostream>#include <string>#include <cstring>#include <cstdio>#include <algorithm>#include <memory>#include <cmath>#include <bitset>#include <queue>#include <vector>#include <stack>using namespace std;const in 阅读全文

posted @ 2012-05-16 17:05 Lvpengms 阅读(293) 评论(0) 推荐(0) 编辑

{HDU}{4193}{Non-negative Partial Sums}

摘要: 对数组进行预处理,由于是连续的可以在O(1)的时间进行判定查询,WA了N次。#include <iostream>#include <string>#include <cstring>#include <cstdio>#include <algorithm>#include <memory>#include <cmath>#include <bitset>#include <queue>#include <vector>#include <stack>using 阅读全文

posted @ 2012-05-16 16:42 Lvpengms 阅读(544) 评论(0) 推荐(0) 编辑

2012年5月15日 #

POJ 3988 Selecting Courses (Greedy)

摘要: {POJ} {3988} {Selecting courses}Greedy Algorithm, time is fixed and just find the earlest finished courses.#include <iostream>#include <string>#include <cmath>#include <cstdio>#include <cstring>#include <cstdlib>#include <ctime>#include <queue>#include 阅读全文

posted @ 2012-05-15 13:01 Lvpengms 阅读(283) 评论(0) 推荐(0) 编辑

{POJ}{3989}{A hard Aoshu Problem}{DFS}

摘要: 10年福州赛区的题目,暴力搜索即可。#include <iostream>#include <string>#include <cstring>#include <cstdio>#include <algorithm>#include <memory>#include <cmath>#include <bitset>#include <queue>#include <vector>#include <stack>using namespace std;#defin 阅读全文

posted @ 2012-05-15 12:58 Lvpengms 阅读(297) 评论(0) 推荐(0) 编辑

2012年4月30日 #

Chess Viewer base on HI-CHESS

摘要: You can use this tools here. 阅读全文

posted @ 2012-04-30 20:32 Lvpengms 阅读(332) 评论(0) 推荐(0) 编辑

My LaTeX Beamer Template For Slides

摘要: \documentclass{beamer}\usecolortheme{whale}\useoutertheme{infolines}\useinnertheme[shadow]{rounded}\usecolortheme{seagull}\setbeamerfont{block title}{size={}}\usefonttheme{structuresmallcapsserif}\mode<all>\usepackage{algorithm}\usepackage{amssymb,amsmath}\usepackage{graphicx}\usepackage{amsfo 阅读全文

posted @ 2012-04-30 15:57 Lvpengms 阅读(1143) 评论(0) 推荐(0) 编辑

XBoard Chess

摘要: XBoard GUIXBoard is a free software on Unix/Linux os, it is just a GUI and it support more thousand engines, in Win Os you can download winboard.You can get XBoard on hereYou can read Online User Guide hereAnd any questions could be asked on Winboard Forumthe lastest version is 4.6.x but it often ab 阅读全文

posted @ 2012-04-30 15:52 Lvpengms 阅读(357) 评论(0) 推荐(0) 编辑

2012年4月18日 #

[转]使用OpenCV进行视频读写

摘要: #include <opencv/cxcore.h>#include <opencv/highgui.h>#include <opencv/cv.h>#undef RC_OPENCV_2_1_0#ifdef _DEBUG#ifdef RC_OPENCV_2_1_0#pragma comment( lib, "cxcore210d.lib" )#pragma comment( lib, "cv210d.lib" )#pragma comment( lib, "highgui210d.lib" ) #e 阅读全文

posted @ 2012-04-18 13:47 Lvpengms 阅读(4947) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 ··· 13 下一页