摘要:
转载自http://hi.baidu.com/love_mj/blog/item/c4b294fd7bb94e1a08244d31.html关于 #param pack n: #pragma pack(4) class TestB { public: int aa; char a; short b; char c; }; int nSize = sizeof(TestB); 这里nSize结果为12,在预料之中。 现在去掉第一个成员变量为如下代码: #pragma pack(4) class TestC { public: char a; ... 阅读全文
摘要:
1 #include<cstdio>//只是因为 k,y1,x1,y2,x2的原因。 2 #include<queue> 3 #include<cstring> 4 using namespace std; 5 int m,n,time; 6 int dir[4][2]={{0,1},{1,0},{-1,0},{0,-1}};//右下上左 0,1,2,3 7 char map[110][110]; 8 int hash[110][110]; 9 struct In10 {11 int x,y,k,time;12 };13 In s,e; 14 int bfs 阅读全文
摘要:
1 #include<cstdio> //hdu2102 2 #include<cstring> 3 #include<queue> 4 using namespace std; 5 const int INF=0x03f3f3f3f; 6 int n,m,t; 7 char map[2][12][12]; 8 int hash[2][12][12]; 9 int dir[4][2] = {{0,1},{1,0},{0,-1},{-1,0}}; 10 11 struct In 12 { 13 int x,y,z,t; 14 }; 15 In e; 16 in 阅读全文