自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

O(1) 的小乐

豆瓣账号: http://www.douban.com/people/sosisarah/

  • 博客(18)
  • 资源 (12)
  • 收藏
  • 关注

原创 Project Euler Problem 32

//很easy的推理得到一定是1*4=4或者3*2=4之类的。(数字代表数的位数)#include #include #include #include unsigned int f(void){ typedef std::set res_set; res_set res; unsigned int digits[9]; unsigned int n1,

2009-12-30 18:17:00 567

原创 Project Euler Problem 31

#include using namespace std;int Pound[]={200,100,50,20,10,5,2,1};int count=0;void Solve(int index, int value){ if(value==0||index==7) { count++; return ; } for(int i=0;i<=valu

2009-12-30 17:37:00 631

原创 Project Euler Problem 30

  太没技术含量了,不可能存在7位及七位数以上的答案,枚举即可获得解答!Answer:443839

2009-12-30 17:02:00 524

原创 Project Euler Problem 16

/*div_tStructure used to represent the value of an integral division performed by div.It has two members of the same type, defined in either order as:int quot; int rem; Members:quot

2009-12-30 16:48:00 512

原创 C++ Templates笔记 8 技巧性基础知识关键字typename

#include #include // print elements of an STL containertemplate void printcoll (T const& coll){ typename T::const_iterator pos; // iterator to iterate over coll typename T::const_iterat

2009-12-30 15:48:00 626

原创 C++ Templates笔记 7 非类型模板参数

#include #include #include #include #include //std::vector 是CONT的缺省值(缺省模板实参)template >class Stack {private: CONT elems; // elementspublic: void push(T const&);

2009-12-30 15:03:00 601

原创 C++ Templates笔记 6 缺省模板实参

#include #include #include #include #include //std::vector 是CONT的缺省值(缺省模板实参)template >class Stack {private: CONT elems; // elementspublic: void push(T const&);

2009-12-30 14:10:00 589

原创 C++ Templates笔记 5 类模板的特化

#include #include #include //#include "stack1.hpp"#include #include #include #include template class Stack { private: std::vector elems; // elements public:

2009-12-30 13:51:00 470

原创 C++ Templates笔记 4 类模板Stack

#include #include #include #include #include template class Stack {private: std::vector elems; // elementspublic: void push(T const&); // push element void pop();

2009-12-30 13:39:00 499

原创 C++ Templates笔记 3 重载函数模板(附加)

#include #include #include // maximum of two values of any typetemplate inline T const& max (T const& a, T const& b){ return a < b ? b : a;}// maximum of two pointerstemplat

2009-12-30 09:54:00 661

原创 C++ Templates笔记 2 重载函数模板

// maximum of two int valuesinline int const& max (int const& a, int const& b) { return a < b ? b : a;}// maximum of two values of any typetemplate inline T const& max (T const& a,

2009-12-30 09:32:00 500

原创 C++ Templates笔记 1

/*可以使用任何类型来实例化该类型的参数,只要所使用的类型提供模板使用的操作即可 鉴于历史原因,你可以使用class来代替typename,来定义类型参数。在C++语言的演化过程中typename出现的相对较晚一些,在它之前,关键字classs是引入类型参数的唯一方式,并一直作为有效方式保留下来。 从语义上讲,class和typename是等将的。即使是template 你也可以使

2009-12-30 08:51:00 584

原创 TUD 2008 Single Porking the Social

#include using namespace std;int main(){ int id[1000000], sz[1000000]; int N; cin >> N; for (int I = 1; I <= N; ++I) { int n, k; cin >> n >> k; //n个人,k个关系 for (int i = 0; i < n;

2009-12-17 20:27:00 433

原创 TDU 2008 Single Prime

  #include #include #include #include using namespace std;const int PN = 10000000;int primes[PN];vector primelist;void sieve() { primes[0] = 0; primes[1] = 0; primes[2] = 1;

2009-12-17 17:11:00 502

原创 SRM 454 Round1 500

http://www.topcoder.com/wiki/display/tc/SRM+454  动态规划的一个经典题目。找到第i个与第i+1个的关系。同时对于此种问题。正确的表示数据,把火柴表示成数字形式,同时计算其差异对于只有对于移入与移除相同的火柴的时候,才是我们所求的答案//So we just want to know at a position N, if we m

2009-12-17 09:53:00 552

转载 STL set

 今日做SRM,用到了SET,整理一下   Set is a Sorted Associative Container that stores objects of type Key. Set is a Simple Associative Container, meaning that its value type, as well as its key type, is Key. It i

2009-12-09 11:42:00 1973

转载 OpenGL学习网站

Sosi整理1  http://www.opengl.org/    OpenGL的官方网站,内容丰富,学习opengl知识的百宝箱,圣地。 2 http://nehe.gamedev.net/       NeHe网站的opengl教程,讲解的非常详细,非常适合初学者,把上面的教程看完,应该对opengl有初步的认识。 3  http://www.sgi.com/products/sof

2009-12-07 21:46:00 984

转载 程设基础面试问题

一、基础知识 1、 下面几个是在编程领域里经常使用的缩写,请写出他们的英文全写,并翻译成中文。注意是编程领域. (1) OS  Operator System (2) VS  Visual Studio ? (3) MS  Microsoft (4) CS  Client/Server ? (5) RTOS Real Time Operator System (6) SDK Software De

2009-12-03 15:58:00 700

OpenGL模型变换和视图变换

模型变换 Void glTranslate(TYPE x,TYPE y,TYPE z); Void glRotate{fd}(TYPE angle,TYPE x,TYPE y,TYPE z); 把当前矩阵与一个表示移动物体的矩阵相乘,以逆时针方向绕着原点到(x,y,z)的直线旋转。Angle是旋转的角度。 Void glScale{fd}(TYPE x,TYPE y,TYPE z) 2 视图变换 Void gluLookat(GLdouble eyex,GLdouble eyey,GLdouble eyez,GLdouble centerx,GLdouble centery,GLdouble centerz,GLdouble upx,GLdouble upy,GLdouble upz)

2009-12-08

OpenGL透视变换详解

Void gluPerspective(GLdouble fovy,GLdouble aspect, GLdouble near, GLdouble far) 函数作用: 创建一个表示对称投影视图矩阵,并把它与当前矩阵相乘。Fovy是yz平面上视野的角度,它的值必须为[0.0,180.0]。aspect是宽高比。near far 是视点与近裁剪面和远裁剪面的距离,这个必须为正的。

2009-12-08

OpenGL视口变换

Void glViewport(Glint x,Glint y,GLsizei width,Glsizei height); 在窗口中定义一个像素矩形,最终的图形将映射到个矩形中。(x,y)参数指定了视口的左下角,width和height表示这个视口矩形的宽度和高度。

2009-12-08

C++ Programing Language

C++编程语言,内置n个pdf 文件。。大家可以好好学习一下!!!C++编程语言哈!!

2009-10-14

C++编码规范与实例

规范C++的写法,适合于行业用,从电脑里找到的,分享了。

2009-10-14

ACM国际大学生程序设计竞赛问题与解析

国际大学生程序设计竞赛问题与解析,挺不错的一本书。。同学给我推荐的。。希望你能够从这里面获得帮助!

2009-10-14

ACM的模板库常用代码

非常非常好用的ACM常用代码,模板库,分享给大家!对ACMer们很有用的哦!!

2009-10-14

C 和 C++ 代码锦囊(Chuck Allison)

C 和 C++ 代码锦囊(Chuck Allison)

2008-03-05

visual c++开发环境入门

Visual c++开发环境入门(2)

2008-03-05

visual c++开发环境入门

Visual C++开发环境入门(1)

2008-03-05

turing

介绍1966至2003图灵奖获得者主要贡献

2008-03-05

空空如也

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

TA关注的人

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