题意:一个房间由m*n个方块组成 每个机器人占据一个方块 这些机器人能够移动 问
这些机器人的移动动作全部完成后 会不会发生冲撞事件解题策略:简单的模拟题目#include#includeusing namespace std;struct
Node{ int x,y; int dir...
分类:
其他好文 时间:
2014-06-07 06:03:49
阅读次数:
205
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
先排序预处理,后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
1 typedef IUnknown * (* CREATEFUNCPTR)(); 2 3
IUnknown * CallCreateInstance(char * name) 4 { 5 HINSTANCE hComponent =
::LoadLibrary(name); 6 ...
分类:
其他好文 时间:
2014-05-28 09:51:43
阅读次数:
176