Stack 一个简单确很有用的数据结构:FILOpackage Stackimport (
"errors" "fmt")const ( defaultLength=100)type Stack struct{ top int size int
element [...
分类:
其他好文 时间:
2014-06-07 05:14:42
阅读次数:
211
#include #include struct pos2d{ int x; int
y;};using namespace std;int main(){
//boost::interprocess::shared_memory_object类是按照单个字节的方式读写共享内存,用...
分类:
其他好文 时间:
2014-06-07 03:57:20
阅读次数:
277
当一个较少字节对齐类型的指针强转为一个较多字节对齐的指针类型时,这样有些时候会产生问题。
在arm的平台上,这个问题比较明显,在x86平台上运行后没这个问题typdef struct{int addr;int rdda;}Test_t;int
main(){short int a;short ...
分类:
其他好文 时间:
2014-06-07 03:40:59
阅读次数:
301
struct shareDataEx : shareData{ int index; int
total_size;};typedef managed_shared_memory::segment_manager segment_manager_t;
//段管理器type...
分类:
其他好文 时间:
2014-05-30 11:23:53
阅读次数:
267
1 #include 2 #include 3 4 #define mymax(a, b)
(a>b) ? a:b 5 6 typedef struct { 7 int x, y, c; 8 } rect_st; 9 10 rect_st
rects[15];11 12 int d...
分类:
其他好文 时间:
2014-05-30 04:35:16
阅读次数:
200
treap模版暂存。以后修改整理。#include#include#include
#includeusing namespace std;struct Node{ Node *ch[2];//左右子树 int
r;//优先级。数值越大,优先级越高 int v;//值 int...
分类:
其他好文 时间:
2014-05-30 01:45:16
阅读次数:
250
1 #include //bfs; 2 #include 3 #include 4
#include 5 using namespace std; 6 struct data 7 { 8 int x,y,t; 9 }now,pos; 10
int n,m,t,dis[...
分类:
其他好文 时间:
2014-05-30 01:26:49
阅读次数:
242
先排序预处理,后01背包。 1 #include 2 #include 3 #include 4 5
#define MAX(a, b) (a>b) ? a:b 6 7 int dp[5000]; 8 9 typedef struct {10 int p,
q, v;11 } s...
分类:
其他好文 时间:
2014-05-29 11:40:04
阅读次数:
277
开始没理解题意。原来destinations是指路的序号。而不是点。DP。 1 #include 2
#include 3 4 int dp[2005]; 5 6 typedef struct { 7 int s, e, w; 8 } road_st; 9 10
road_st ro...
分类:
其他好文 时间:
2014-05-29 09:18:50
阅读次数:
325
#include #include #include int gettimeofday(struct
timeval*tv,struct timezone *tz);int main(int argc, char* argv[]){ int timeuse;
struct timeva...
分类:
其他好文 时间:
2014-05-29 09:00:28
阅读次数:
290