自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(96)
  • 资源 (7)
  • 收藏
  • 关注

转载 用GDB调试程序

http://dsec.pku.edu.cn/~yuhj/wiki/gdb.html说明从CSDN的网站上找到的GDB使用说明。 原文标题:用GDB调试程序作者:haoel (QQ是:753640,MSN是: [email protected])关键字:gdb 调试 c c++ gun这篇文章非常好,所以转载了下来,作为收藏。topGDB概述GDB 是GNU开源组织发布的一个强大的UNIX下的程序

2008-02-13 15:06:00 1823 1

转载 TopCoder arena plugin

How to use ExampleBuilder PluginExampleBuilder is a CodeProcessor plug-in that, given a ProblemComponentModel, produces code to test the examples in the target language.The plug-in expects a J

2007-12-11 19:22:00 2639

转载 Binary Search

By lovro TopCoder Member Binary search is one of the fundamental algorithms in computer science. In order to explore it, well first build up a theoretical backbone, then use that to implemen

2007-12-11 00:15:00 4197 1

转载 Algorithm Games

By rasto6sk TopCoder Member Introduction The games we will talk about are two-person games with perfect information, no chance moves, and a win-or-lose outcome. In th

2007-12-03 17:38:00 1639

转载 The Sprague-Grundy theory of impartial games

An impartial game is a two-player game in which both players have complete information, no chance is involved, and the legal moves from each position are the same for both players. We will deal with

2007-12-03 08:39:00 1885

转载 Disjoint-set Data Structures

By vlad_D TopCoder MemberIntroduction Many times the efficiency of an algorithm depends on the data structures used in the algorithm. A wise choice in the structure you use in solving a p

2007-11-30 06:07:00 3418

原创 错位排列

看一道题目:n个士兵晚上巡逻,每人配备一把枪,如果n个人完全随机取一把枪,至少有一个人取到自己的枪的概率是多少? 可以先求每个人拿到不是自己的枪的概率 P, 则1-P为题目所求记每个人都拿不是自己的枪的情况的数目为 f (n),  则有以下递推式易知f(1)=0; f(2)=1n>=3时,  有f(n)=(f(n-1)+f(n-2))*(n-1)具体怎么来的呢,  考虑其中的一人a1, 它对应的枪

2007-11-24 00:04:00 2699

原创 alpha-beta剪枝搜索

   // basic Alpha-Beta search;     move bestmove;    int alphabeta(int depth, int alpha, int beta, bool isMyTurn) ...{     if (gameOver || depth == 0) ...{      return evaluation();     }     

2007-11-21 19:37:00 4103

转载 using tries

By luison9999 TopCoder Member IntroductionThere are many algorithms and data structures to index and search strings inside a text, some of them are included in the standard libraries, but

2007-11-21 18:44:00 1220

原创 图形学笔记2——反走样 (antialiasing)

在光栅显示器上显示图形时,直线段或图形边界或多或少会呈锯齿状。原因是图形信号是连续的,而在光栅显示系统中,用来表示图形的却是一个个离散的象素。这种用离散量表示连续量引起的失真现象称之为走样(aliasing);用于减少或消除这种效果的技术称为反走样(antialiasing)。光栅图形的走样现象除了阶梯状的边界外,还有图形细节失真(图形中的那些比象素更窄的细节变宽),狭小图形遗失等现象。常用的反走

2007-10-11 20:38:00 6351

原创 图形学笔记1——直线段扫描转换算法

 DDA法已知过端点P0(x0, y0), P1 (x1, y1)的直线段; 直线斜率k = (y1-y0) / (x1-x0) .画线过程为: 从x的左端点x0开始,向x右端点 步进,步长=1(像素),按y=k x + b 计算相应的y坐标,并去像素点(x, round (y) )作为当前点的坐标。可以提高效率:设步长为Δx, 有x i+1 = xi +Δx, 于是: yi+

2007-10-11 02:50:00 4777 2

转载 A bit of fun: fun with bits

Introduction Most of the optimizations that go into TopCoder contests are high-level; that is, they affect the algorithm rather than the implementation. However, one of the mos

2007-10-06 01:50:00 2426

转载 JavaScript Optimization

IntroductionThis document is intended to serve a number of purposes. One, it is intended to be a compendium of JavaScript optimization techniques, a place where one can turn to find optimization e

2007-09-29 02:00:00 1235

原创 Prim最小生成树算法

MST-PRIM(G, w, r)// G: graph, w: weight, r:root 1  for each u ∈ V [G] 2       do key[u] ← ∞ 3          π[u] ← NIL 4  key[r] ← 0 5   Q ← V [G] 6   while Q ≠ Ø 7       do u ← EXTRACT-MIN

2007-09-19 13:51:00 2276

原创 计算程序运行时间

#include       clock_t start =clock();    /**//*        start timing    */    clock_t end=clock();    double time=((double)(end-start))/(double)CLK_TCK;    printf("%g ", time); 

2007-09-19 13:32:00 1154

转载 详细解说 STL 排序(Sort)

作者Winter 0 前言: STL,为什么你必须掌握 对于程序员来说,数据结构是必修的一门课。从查找到排序,从链表到二叉树,几乎所有的算法和原理都需要理解,理解不了也要死记硬背下来。幸运的是这些理论 都已经比较成熟,算法也基本固定下来,不需要你再去花费心思去考虑其算法原理,也不用再去验证其准确性。不过,等你开始应用计算机语言来工作的时候,你会 发现,面对不同的需求你需要一次又一次去用

2007-09-04 01:29:00 1306

转载 详细解说STL string

0 前言: string 的角色 1 string 使用   1.1 充分使用string 操作符   1.2 眼花缭乱的string find 函数   1.3 string insert, replace, erase 2 string 和 C风格字符串 3 string 和 Charactor Traits 4 string 建议 5 小结 6 附录 7 参考文章0 前言: string

2007-08-31 04:27:00 1636 1

原创 筛法求素数+分解质因子+欧拉函数+求约数

bool prime[31700];  // 31700*31700 > 1000000000int primes[3500];int cnt=0;    // 筛法求素数void sieve()...{    memset(prime, 1, sizeof(prime));    prime[0]=false;    prime[1]=false;    int m=31700;    

2007-08-26 21:43:00 3327 2

转载 详细解说STL hash_map系列

原文:http://www.stlchina.org/twiki/bin/view.pl/Main/STLDetailHashMap 为什么需要hash_map用过map吧?map提供一个很常用的功能,那就是提供key-value的存储和查找功能。例如,我要记录一个人名和相应的存储,而且随时增加,要快速查找和修改: 岳不群-华山

2007-08-24 02:27:00 1653

原创 vc++2005 和 g++中使用hash_map

hash_map不在C++98/2003标准中,因此在VC++2005和g++中使用的方法略有区别。【1】VC++2005#include hash_map> // 注意头文件和namespaceusing namespace stdext; int main()...{    hash_mapstring, int> hmap;    return 0;}【2】g++#i

2007-08-24 02:04:00 2616

转载 Power up C++ with STL: Part IV (Implementing real algorithms)

I strongly recommend you to read the three articles below first.Power up C++ with STL: Part I (introduction, vector)Power up C++ with STL: Part II (string, set, map)Power up C++ with STL: Part III (m

2007-08-20 03:43:00 2746 1

转载 Power up C++ with STL: Part III (more on STL)

I strongly recommend you to read the two articles below first.Power up C++ with STL: Part I (introduction, vector) Power up C++ with STL: Part II (string, set, map)Creating Vector from Map As you alr

2007-08-20 03:32:00 1573

转载 Power up C++ with STL: Part II (string, set, map)

See Power up C++ with STL: Part I (introduction && vector) String There is a special container to manipulate with strings. The string container has a few differences from vector. Most of the differenc

2007-08-18 16:15:00 2298

转载 Power up C++ with STL: Part I (introduction, vector)

Perhaps you are already using C++ as your main programming language to solve TopCoder problems. This means that you have already used STL in a simple way, because arrays and strings are passed to your

2007-08-18 02:43:00 3745

原创 C++ BigInteger (beta version)

#include deque>#include #include #include #include using namespace std;class DividedByZeroException ...{};class BigInteger...{    private:        vectorchar> digits;         bool sign;          //  

2007-08-11 13:49:00 8784 2

原创 关于C++ , java继承重载

C++ 重载只能是同一个类中,子类重载的话,父类里面的同名方法就被隐藏掉了,即使参数不同用限定符 :: 可以找到~ #includeiostream>using namespace std;class Base ...{public:    void foo (int i) ...{        cout"Base foo int "iendl;;    }    void foo ()

2007-07-30 02:12:00 1385

原创 Java大整数实现计算catalan数

Problem: http://acm.sgu.ru/problem.php?contest=0&problem=130CircleOn a circle border there are 2k different points A1, A2, ..., A2k, located contiguously. These points connect k chords so that each of

2007-07-29 07:57:00 2048

原创 平摊分析 (amortized analysis) -算法导论学习笔记

http://freelet.blogspot.com/2008/12/amortized-analysis.html在平摊分析中,执行一系列数据结构操作所需要的时间是通过执行的所有操作求平均而得出的。平摊分析可以用来证明在一系列操作中,通过对所有操作求平均之后,即使其中单一的操作具有较大的代价,平均代价还是很小的。平摊分析不牵涉到概率, 平摊分析保证在最坏情况下,每个操作具有的平均性能。

2007-07-18 02:09:00 36444 1

转载 Introduction to String Searching Algorithms

Rabin-Karp and Knuth-Morris-Pratt Algorithms By TheLlama TopCoder Member The fundamental string searching (matching) problem is defined as follows: given

2007-07-16 21:27:00 1808

原创 给CSDN博客侧栏添加搜索功能

利用百度博客搜索 给csdn博客添加全文搜索功能发现百度博客搜索对CSDN博客基本能搜到全部文章, 而且时效性好..而google的Blogsearch对csdn blog不行.可以去百度博客搜索submit一下你的博客:http://utility.baidu.com/blogsearch/submit.php在 "配置-公告" 中添加如下代码:将yourID替换成你的ID(例如:touzani

2007-07-15 13:21:00 1037

原创 0/1背包问题解法

对n个物品进行编号1,2...n最优子结构:假设对一个重量为W,n个物品的最优解法是S. 设解法S中所拿的物品最大的编号是i.则S-{i}一定是对于重量为W − Wi , 包含物品为1…i-1的最优解 Dynamic progamming:定义 c[i,w]为对于最大重量为w,物品为1….i的解法的价值则有c[i,w] =   0              

2007-07-14 15:23:00 1496

原创 字符串匹配(string matching)算法之二:利用有限自动机

上一篇:字符串匹配(string matching)算法之一 (Naive and Rabin_Karp)有限自动机:一个有限自动机M是一个5元组(Q, q0, A, Σ, δ), 其中:·         Q是状态的有限集合·         q0 ∈ Q 初始状态·         A ⊆ Q 是一个接受状态的集合·         Σ 有限的输入字母表·   

2007-07-12 23:31:00 5243 2

原创 图论基础

图的表示常用的两种方法:邻接表与邻接矩阵每一个点对应一个集合set(邻接表),存储与此点相连的点。 1. -)点用连续存储  a. 邻接表用连续存储表    b. 邻接表用链式表   List neighbors[max_size];二)点与邻接表都用链式表class Edge{Vertex *end_point;  //边的终点Edge *next_edge;    //邻接表的下一条边  } 

2007-07-12 16:45:00 1522

原创 MFC使用GDI+编程基础

MFC使用GDI+编程设置VC2005“项目/*属性”菜单项,打开项目的属性页窗口,先选“所有配置”,再选“配置属性/链接器/输入”项,在右边上部的“附加依赖项”栏的右边,键入GdiPlus.lib 后按“应用”钮,最后按“确定”钮关闭对话框。在需要用到GDI+的文件头加上下面两句#include using namespace Gdiplus;在应用程序类应用程序类(CGDIPlusDemoAp

2007-06-17 21:08:00 15003 5

转载 WAVE Sample Files

关于画wav文件声音数据波形图,  见上篇日志http://blog.csdn.net/touzani/archive/2007/06/17/1654943.aspx 下面这篇文章有各种格式的wav文件地址, 可以做为素材..以供测试..原文地址: http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Samples.htmlThe

2007-06-17 14:22:00 4206

原创 画出wav文件声音数据的波形曲线

by Touzani        WAV文件格式波形音频文件(*.WAV)是Microsoft为Windows设计的多媒体文件格式RIFF(The Resource Interchange File Format,资源交换文件格式)中的一种(另一种常用的为AVI)。RIFF由文件头、数据类型标识及若干块(chunk)组成。 WAV文件的基本格式

2007-06-17 09:40:00 16594 10

原创 读显图像文件程序(MFC)

程序功能:实现打开文件过滤、创建滚动视图类、对小图使子窗口按适应图大小、对大图支持子窗口的滚动。另存为功能,方便图片格式的转换下面是步骤:VC++2005  创建MFC应用程序->多文档项目Image在“MFC应用程序向导”最后一步的“生成的类”页,将C*View的基类从缺省的CView改成CScrollView。 ImageDoc.h 添加#include      

2007-06-12 02:31:00 3106 1

原创 泛型编程与STL

泛型编程(generic programming通用编程/类属编程)和面向过程以及面向对象一起,是混合型程序设计语言C++所包含的三种编程风范(paradigm范例/范型)。传统C++的泛型编程,仅仅局限于简单的模版技术。标准C++新引入了容器(container)、迭代器(iterator)、分配器(allocator)和STL(Standard Template Library标准模板库)

2007-06-08 14:32:00 5534 1

原创 STL容器

容器(container)是装有其他对象的对象。容器里面的对象必须是同一类型,该类型必须是可拷贝构造和可赋值的,包括内置的基本数据类型和带有公用拷贝构造函数和赋值操作符的类。典型的容器有队列、链表和向量等。在标准C++中,容器一般用模版类来表示。不过STL不是面向对象的技术,不强调类的层次结构,而是以效率和实用作为追求的目标。所以在STL并没有一个通用的容器类,各种具体的容器也没有统一

2007-06-08 14:27:00 2253

原创 STL之map

映射容器map是一种关联容器,表示的是对偶(键,值)的序列。它支持唯一Key类型的键值,并提供对另一个基于键的类型T的快速检索。map还提供双向迭代器。映射容器map在标准C++中,对应于map类,被定义在头文件中。映射:键→值,值 = 映射[键](似f:x → y,y = f(x))。即,可以通过映射,由键来快速定位值。namespace std { // 取自C++2003标准te

2007-06-08 14:18:00 2805

viewbar.1.03.exe

viewbar.1.03.exe

2007-07-31

MFC绘图小程序

最新版,欢迎下载玩玩

2007-07-18

draw.exe

绘图小软件~~

2007-06-17

C++ programmer's reference.chm

very good~~~

2007-05-28

牛顿二项式定理的证明

牛顿二项式定理的证明

2007-05-19

绘图程序

未完成

2007-05-19

源代码cpp

cpp

2007-05-16

空空如也

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

TA关注的人

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