静态字典树。 1 #include 2 #include 3 #include 4 5 #define MAXN 10005 6 7 typedef struct Trie { 8 bool v; 9 Trie *next[10];10 Trie() {11 ...
分类:
其他好文 时间:
2014-06-28 09:39:33
阅读次数:
171
今天在定义结构体的时候发现typedef struct与struct定义结构体有一些不同之处:
结构也是一种数据类型, 可以使用结构变量, 因此, 象其它 类型的变量一样, 在使用结构变量时要先对其定义。
定义结构变量的一般格式为:
struct 结构名
{
类型 变量名;
类...
分类:
其他好文 时间:
2014-06-28 08:50:46
阅读次数:
147
1、下面是一个结构的定义:
public struct Point
{
public int X { get; set; }
public int Y { get; set; }
}
什么时候用结构:
用于小型的数据结构
其中的值一般不修改...
分类:
其他好文 时间:
2014-06-28 08:38:41
阅读次数:
164
学长说现在基本上可以开始学习STL中一些标准模板了,今天先总结一下 队列、栈、优先队列
1、队列(queue)
先进先出原则,头文件#include ,定义结构queue名称;queueq、queueq等;
如:
struct node
{
int x;
}f;
queueq;//结构体类型队列
q.push(f) //将f压入队列的尾部
node t...
分类:
其他好文 时间:
2014-06-28 08:36:49
阅读次数:
162
本篇文章记录字符设备的驱动框架:1.定义cdev接口体和class结构体#define HELLO_CNT 2static int major = 0;//主设备号为0,需要让系统自动生成主设备号static struct cdev hello_cdev;static struct class *c...
分类:
系统相关 时间:
2014-06-27 22:36:58
阅读次数:
423
DFS+字典树。 1 #include 2 #include 3 #include 4 5 typedef struct Trie { 6 int v; 7 Trie *next[26]; 8 } Trie; 9 10 Trie root; 11 int ...
分类:
其他好文 时间:
2014-06-27 14:32:44
阅读次数:
183
通过读取系统网络接口信息,获取当前iphone设备的流量相关信息,统计的是上次开机至今的流量信息.?1. [代码][C/C++]代码 -(void)checkNetworkflow{ struct ifaddrs *ifa_list = 0, *ifa; if (getifaddrs(&ifa...
分类:
其他好文 时间:
2014-06-27 11:46:05
阅读次数:
223
字典树简单题。 1 #include 2 #include 3 #include 4 5 typedef struct Trie { 6 Trie *next[26]; 7 char str[15]; 8 } Trie; 9 10 Trie root;11 12 void c...
分类:
其他好文 时间:
2014-06-27 11:32:27
阅读次数:
172
统计每种垃圾的总和,若将K种垃圾倒入第F个垃圾桶,那么花费就是K-F(k) (自己已经有的垃圾不用倒)。
然后就是简单的二分图建图。
#include
#include
#include
#include
using namespace std;
#define MAXN 1000
#define MAXM 1000000
#define INF 0x3f3f3f3f
struct ...
分类:
其他好文 时间:
2014-06-27 07:47:46
阅读次数:
205
题意:N,T,S,E:给你T条边,每条边两端都有编号和权值,问从S走到E允许走N条边,求最短路。
foyld加矩阵快速幂思想。
注意要把边离散
#include
#include
#include
#include
using namespace std;
#define M 303
#define inf 0x3fffffff
struct node
{
...
分类:
其他好文 时间:
2014-06-27 07:39:23
阅读次数:
178