- 博客(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 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模型变换和视图变换
2009-12-08
OpenGL透视变换详解
2009-12-08
OpenGL视口变换
2009-12-08
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人