先定义一个最简化的事件数据结构typedef struct{ unsigned char event_flg; unsigned char event_cnt_buf[event_flg_wide]; void (*pEventCallback[event_flg_wide])(v...
分类:
其他好文 时间:
2014-08-12 18:20:04
阅读次数:
218
Trie树模板
#include
using namespace std;
struct Trie
{
int word[100020<<2][26];
int ex[100020<<2];
int sz;
Trie()
{
sz=1;
memset(word,0,sizeof(word));
memset(...
分类:
其他好文 时间:
2014-08-12 17:15:24
阅读次数:
180
很容易想到递归,实现确实不是太容易,对本人来说。
平衡二叉树是有序的,要求链表也是有序。
代码:
#include
//平衡二叉树转化为双向链表
using namespace std;
typedef struct tree{
int data;
struct tree *lchild;
struct tree *rchild;
}Tree,*pTree;
void...
分类:
其他好文 时间:
2014-08-12 13:37:24
阅读次数:
189
解题报告
题目传送门
题意:
求矩形面积并
思路:
扫描线+线段树。要离散化,坐标是浮点型的。
对于线段树(区间)与点坐标对应起来可以这样
区间[1,4]对应的线段树。
#include
#include
#include
#include
using namespace std;
struct Seg
{
int v;
double lx,rx,...
分类:
其他好文 时间:
2014-08-12 13:35:04
阅读次数:
250
寻踪浅析 封装、继承、多态是面向对象语言的三大特性,熟悉C++的人对此应该不会有太多异议。C语言提供的struct,顶多算得上对数据的简单封装,而C++的引入把struct“升级”为class,使得面向对象的概念更加强大。继承机制解决了对象复用的问题,然而多重继承又会产生成员冲突的问题,虚继承在我....
分类:
其他好文 时间:
2014-08-12 13:25:04
阅读次数:
250
struct op( name = "ccc")coc = #( cc = op name: 20 , op name: "name" )--- 保存数组配置o = gt_max_namespace.gt_cl_hp_fileiooutin(); o. setfile "c://t.txt" ...
分类:
其他好文 时间:
2014-08-12 12:55:34
阅读次数:
146
题目一:Populating
Next Right Pointers in Each Node
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Popul...
分类:
其他好文 时间:
2014-08-12 09:03:43
阅读次数:
201
class Edge { enum Type { inner, outer, flat } Piece parent; Type type; boolean fitsWith(Edge type) { }; // Inners & outer f...
分类:
其他好文 时间:
2014-08-12 06:51:13
阅读次数:
208
package main import ( "encoding/json" "fmt" "os") type ConfigStruct struct { Host string `json:"host"` Port ...
分类:
Web程序 时间:
2014-08-12 05:44:33
阅读次数:
231
解题报告
题目传送门
题意:
求矩形并面积。
思路:
离散+线段树+扫描线。
#include
#include
#include
#include
using namespace std;
struct Seg {
int v;
double h,lx,rx;
friend bool operator < (Seg a,Seg b) {
...
分类:
其他好文 时间:
2014-08-12 00:49:03
阅读次数:
260