码迷,mamicode.com
首页 >  
搜索关键字:invalid namespace    ( 44721个结果
第十二周项目3-摩托车继承自行车和电动车
#include #include #include using namespace std; enum vehicleStaus {rest, running}; //车辆状态:泊车、行进 class vehicle //车辆类,虚基类 { protected: int maxSpeed; //最大车速 int currentSpeed;...
分类:其他好文   时间:2014-05-15 15:05:01    阅读次数:262
二分查找需要注意的Bug
#include #include using namespace  std; //下面一个移位是一样的,>>相当于除去2,主要是要用right-left,否则对于大数据来说会产生溢出问题。切记 int binarySearch(int arr[],int len,int number) {     int left=0;     int right=len-1;     in...
分类:其他好文   时间:2014-05-15 07:14:38    阅读次数:272
九度 1339
#include #include #include #include using namespace std; #ifdef ONLINE_JUDGE #define FINPUT(file) 0 #define FOUTPUT(file) 0 #else ...
分类:其他好文   时间:2014-05-15 06:27:05    阅读次数:230
12 周 长颈鹿类对动物类的继承 private继承方式下
#include using namespace std; class Animal { public: Animal() {} void eat() { cout << "eat\n"; } protected: void play() { cout << "play\n"; }...
分类:其他好文   时间:2014-05-15 06:21:51    阅读次数:234
hdu AC me
/* * hdu AC Me * date 2014/5/13 * state AC */ #include #include #include #include using namespace std; const int MAXN=100001; char Arr[MAXN]; int cnt[26]; int main() { //cout << "Hello wor...
分类:其他好文   时间:2014-05-15 06:16:24    阅读次数:247
hdu how many prime numbers 筛选法求素数
/* * hdu How many prime numbers * date 2014/5/13 * state AC */ #include #include #include using namespace std; bool isPrime(int x) { int sqr=sqrt(x*1.0); for(int i=2;i<=sqr;i++) {...
分类:其他好文   时间:2014-05-15 05:07:18    阅读次数:261
12周 项目2 老师兼干部类
#include #include using namespace std; class Teacher { public: Teacher(string nam,int ag,char s,string ad,int num,string t) { name=nam; age=ag; sex=s; ...
分类:其他好文   时间:2014-05-15 04:32:56    阅读次数:262
HDU 4285 circuits
插头DP。 题目要求构造出K条回路的方案数,而且不能出现环套环。 Sol:通过增加标记为来记录形成的回路数,假如不形成环的话就是在形成新的环路,此时,两边的插头个数要为偶数。 #include #include #include #include using namespace std; const int MAXD=15; const int STATE=1000010; const i...
分类:其他好文   时间:2014-05-15 03:53:23    阅读次数:272
UVa 10308 Roads in the North 树的直径
题目来源:UVa 10308 Roads in the North 题意:求距离最远的2点之间的距离 思路:裸的树的直径 或者树形DP #include #include #include using namespace std; const int maxn = 100010; struct node { int to, w; node(){} node(int to, int...
分类:其他好文   时间:2014-05-15 03:37:18    阅读次数:295
hdu 最小公倍数
/* * hdu 最小公倍数 * date 2014/5/13 * state AC */ #include using namespace std; int gcd(int x,int y) { while(x!=y) { if(x>y)x=x-y; else y=y-x; } return x; } int main() ...
分类:其他好文   时间:2014-05-14 14:29:59    阅读次数:225
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!