码迷,mamicode.com
首页 >  
搜索关键字:namespace    ( 41927个结果
hdu 1506 Largest Rectangle in a Histogram(单调栈)
题意:给出n个宽度为1 高度为hi的长方形 问能圈出的最大长方形面积多大思路:http://blog.csdn.net/dgq8211/article/details/7740610#include#include#include#include#includeusing namespace ...
分类:其他好文   时间:2015-04-06 16:59:57    阅读次数:118
动态规划 01背包学习中
#include#include#includeusing namespace std;//int ct=0;//int arr[1000]={0};struct Bag{ int kg; int value;};Bag sth[6]={0,0,2,6,2,3,6,5,5,4,4,6};int ba...
分类:其他好文   时间:2015-04-06 16:58:50    阅读次数:118
枚举结构和结构类型
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Diagnostics;namespace Cons...
分类:其他好文   时间:2015-04-06 16:57:18    阅读次数:120
第五周 程序阅读——指针(2)
#include using namespace std; class CE { private: int a,b; int getmin(){return (a<b? a:b);} public: int c; void SetValue(int x1,int x2, int x3) { a=x1; b=x2; ...
分类:其他好文   时间:2015-04-06 15:50:33    阅读次数:161
第五周 程序阅读——const
#include #include using namespace std; class Student { public: Student() {} Student( const string& nm, int sc = 0 ): name(nm), score(sc){} //(1)下面的const干神马?_____________ void set_stu...
分类:其他好文   时间:2015-04-06 15:50:01    阅读次数:138
第五周 程序阅读——static(2)
#include using namespace std; class Test{ private: static int val; int a; public: static int func(); static void sfunc(Test &r); }; int Test::val=20; int Test::func() {...
分类:其他好文   时间:2015-04-06 15:48:08    阅读次数:122
第五周 项目一-体验成员函数
问题   设计平面坐标点类,计算两点之间距离、到原点距离、关于坐标轴和原点的对称点等。在设计中,由于求距离、求对称点等操作对原对象不能造成任何改变,所以,将这些函数设计为常成员函数是合适的,能够避免数据成员被无意更改。   代码   #include #include using namespace std; class CPoint { private: double x; ...
分类:其他好文   时间:2015-04-06 15:44:11    阅读次数:107
nyoj-布线问题
这题我用prim算法和kruskal算法都提交了一下从代码量来看,prim算法更简洁一些,从时间复杂度来看,prim:O(n^2),kruskal:O(mlogm),kruskal更优kruskal:#include #include #include using namespace std;co....
分类:其他好文   时间:2015-04-06 15:41:45    阅读次数:137
用c++实现获取程序运行的时间
1 #include 2 #include 3 using namespace std; 4 int main() 5 { 6 time_t begin,end; 7 begin=clock(); 8 cout<<"**************************\n\...
分类:编程语言   时间:2015-04-06 15:41:17    阅读次数:145
CodeForces 487A Fight the Monster
1 #include 2 #include 3 using namespace std; 4 int judge(int hy,int ay,int dy,int hm,int am,int dm)//计算特定的攻击与防御之下,需要加多少hp 5 { 6 if(am t2)17 ...
分类:其他好文   时间:2015-04-06 15:34:55    阅读次数:203
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!