码迷,mamicode.com
首页 >  
搜索关键字:struct enum    ( 22969个结果
第十二周项目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
HDU 4565 So Easy!
线性推,矩阵乘法+快速幂求通项。 传送门:点击打开链接 #include #include #include #include using namespace std; #define LL long long struct Mat{ LL f[2][2]; }; LL MOD; Mat mul(Mat a,Mat b) { LL i,j,k; ...
分类:其他好文   时间:2014-05-15 14:53:10    阅读次数:225
Leetcode 树 Binary Tree Level Order Traversal
题意:给定一棵二叉树,返回按层遍历的结果 思路1:bfs,定义一个新的struct,记录指针向节点的指针和每个节点所在的层 复杂度1:时间O(n),空间O(n) 思路2:dfs 递归函数: void levelOrder(TreeNode *root, int level, vector<vector >&result) 表示把根为root的树按层存放在result中,其中level表示当前的层数 复杂度2:时间O(n),空间O(n) 相关题目:...
分类:其他好文   时间:2014-05-15 14:46:06    阅读次数:355
linux c 网络编程:用域名获取IP地址或者用IP获取域名 网络地址转换成整型 主机字符顺序与网络字节顺序的转换
用域名获取IP地址或者用IP获取域名 #include #include #include int main(int argc,char **aggv) { struct hostent *host; char hostname[]="www.163.com"; char hostname2[]="www.baidu.com"; s...
分类:系统相关   时间:2014-05-15 06:15:07    阅读次数:406
leetcode -day14 Populating Next Right Pointers in Each Node I II
1、 ?? Populating Next Right Pointers in Each Node Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate...
分类:其他好文   时间:2014-05-15 04:57:36    阅读次数:221
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
学习C/C++语言:结构体,动态链表
//*************************************************************** //结构体:简单的静态链表 #include #include #define NULL 0 #define SIZE 10 struct student { char num[SIZE]; float score; struct student *next; ...
分类:编程语言   时间:2014-05-15 02:55:09    阅读次数:359
字符串转日期
//Processing date     struct tm time; std::string date; char dateBuff[128] = {0}; time.tm_year = atoi(md_date.getString().substr(0,4).c_str()) - 1900; time.tm_mon =  atoi(md_date.getString().subs...
分类:其他好文   时间:2014-05-14 21:52:15    阅读次数:248
HDU--2846--Repository--字典树
#include #include #include #include #include #include using namespace std; struct ssss { ssss *c[26]; int n,v; }*s; void insert(char *str,int v) { int i,j,k,l; ssss *p,*q; p=...
分类:其他好文   时间:2014-05-14 15:06:54    阅读次数:357
hdu 开门人和关门人
/* * hdu OpenDoorManAndCloseDoorMan * date 2014/5/13 * state AC */ #include #include #include #include using namespace std; struct DoorMan { char name[20]; int startH,startM,startS; ...
分类:其他好文   时间:2014-05-14 14:58:40    阅读次数:247
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!