|
11451254188 (22029-mjh)
|
6ms |
392 KiB |
|
206 Bytes |
2023-5-18 19:29:47 |
|
姚宏逸
|
6ms |
264 KiB |
|
233 Bytes |
2022-5-29 11:42:34 |
|
Tang
|
6ms |
256 KiB |
|
237 Bytes |
2022-7-2 11:24:26 |
|
赵沛喆
|
6ms |
256 KiB |
|
255 Bytes |
2022-3-27 11:15:55 |
|
1396013295
|
6ms |
264 KiB |
|
291 Bytes |
2022-1-30 20:38:14 |
|
黄梓桐 (HuangZiTong)
|
7ms |
256 KiB |
|
206 Bytes |
2022-11-5 19:44:50 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
7ms |
256 KiB |
|
196 Bytes |
2022-11-6 19:10:18 |
|
wangzihang
|
7ms |
312 KiB |
C++ |
215 Bytes |
2022-8-6 10:09:15 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
7ms |
256 KiB |
|
196 Bytes |
2022-11-6 19:10:17 |
|
wangruibo20xh
|
7ms |
320 KiB |
|
215 Bytes |
2022-2-11 19:35:53 |
|
林小博
|
7ms |
384 KiB |
|
196 Bytes |
2022-11-20 20:54:42 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
7ms |
264 KiB |
|
196 Bytes |
2022-11-6 19:10:16 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
7ms |
256 KiB |
|
196 Bytes |
2022-11-6 19:10:18 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
7ms |
312 KiB |
|
196 Bytes |
2022-11-6 19:10:16 |
|
dengduxi
|
8ms |
264 KiB |
|
206 Bytes |
2023-1-1 13:55:48 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
8ms |
384 KiB |
|
196 Bytes |
2022-10-23 16:28:21 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
8ms |
264 KiB |
|
196 Bytes |
2022-11-6 19:10:17 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
8ms |
256 KiB |
|
196 Bytes |
2022-11-6 19:10:18 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
8ms |
256 KiB |
|
196 Bytes |
2022-11-6 19:10:17 |
|
时代一校林星宇 (lxy)
|
8ms |
392 KiB |
|
206 Bytes |
2022-10-29 19:31:55 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
8ms |
256 KiB |
|
196 Bytes |
2022-11-6 19:10:17 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
8ms |
268 KiB |
|
196 Bytes |
2022-11-6 19:10:19 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
8ms |
316 KiB |
|
196 Bytes |
2022-11-6 19:10:14 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
8ms |
260 KiB |
|
196 Bytes |
2022-11-6 19:10:17 |
|
杨浩灵 (金坷拉)
|
9ms |
368 KiB |
|
218 Bytes |
2022-10-28 23:28:50 |
|
zhangzhimo
|
9ms |
384 KiB |
|
206 Bytes |
2022-12-4 11:13:49 |
|
徐康景 (dcm)
|
9ms |
316 KiB |
|
196 Bytes |
2022-12-9 23:00:53 |
|
谁陪訫牞 (杀手) (22029-zys)
|
9ms |
312 KiB |
|
206 Bytes |
2023-1-5 16:36:16 |
|
周琪渃
|
10ms |
384 KiB |
|
207 Bytes |
2022-11-7 20:16:26 |
|
zhouxifei
|
10ms |
384 KiB |
|
179 Bytes |
2023-5-8 18:48:55 |
|
JOKER (hhy)
|
10ms |
7 MiB |
C++98 |
480 Bytes |
2024-5-25 21:10:15 |
|
wangzihang
|
11ms |
512 KiB |
|
215 Bytes |
2023-2-18 13:51:05 |
|
范宜灵
|
11ms |
512 KiB |
|
230 Bytes |
2023-2-25 13:53:57 |
|
叶雨昊 (yeyuhao22006)
|
11ms |
384 KiB |
|
189 Bytes |
2023-2-22 19:20:55 |
|
朱泽晟
|
11ms |
400 KiB |
|
254 Bytes |
2023-2-18 15:49:16 |
|
胡宸华 (huchenhua)
|
11ms |
6.9 MiB |
|
183 Bytes |
2023-8-20 21:05:15 |
|
ysf.wlanwq.ZJSWL 1922~1991 (韦舒豪)
|
11ms |
6.7 MiB |
C++98 |
192 Bytes |
2024-8-2 16:56:04 |
|
乐瀚阳 (yuehanyang)
|
11ms |
6.8 MiB |
|
189 Bytes |
2023-6-15 19:26:56 |
|
Erin
|
11ms |
7 MiB |
C++98 |
191 Bytes |
2024-6-5 11:23:20 |
|
时代2校-程俊燃 (chengjunran)
|
11ms |
6.7 MiB |
|
191 Bytes |
2023-8-27 11:02:50 |
|
在煎鱼的肖大总铳 (肖宇航)
|
11ms |
6.8 MiB |
|
236 Bytes |
2023-10-12 22:04:21 |
|
蒲梓勋 (puzixun)
|
11ms |
392 KiB |
|
202 Bytes |
2023-2-18 13:43:18 |
|
maobohan
|
11ms |
6.8 MiB |
|
187 Bytes |
2023-9-23 11:09:23 |
|
手搓STL stack 双向无环链表 _ 向量 2种实现方式: template <typename Map_Type> class Stack_l /* Stack _ List */ { private: struct Node { Map_Type Node_Data; Node *nextp, *lastp; Node(void) { nextp = 0; lastp = 0; } }; struct List_Data { unsigned int List_Size; Node *headp, *endp; List_Data(void) { List_Size = 0; headp = 0; endp = 0; } }Data; struct Vector_Data { Map_Type *headp, *lastp, *endp; void resize(unsigned int data_size) { Map_Type *newp = new Map_Type[data_size](); endp = newp + data_size - 1; lastp = newp + (data_size > lastp - headp ? lastp - headp : data_size); if (headp) delete[] headp; headp = newp; } Vector_Data(void) { headp = 0; lastp = 0; endp = 0; } }; public: unsigned int size(void) { return Data.List_Size; } Map_Type& top(void) { return Data.endp -> Node_Data; } void* data(void) { return &Data; } bool empty(void) { return !((bool)Data.headp); } Stack_l<Map_Type>& push(Map_Type push_data) { Node *nodep = new Node(); nodep -> lastp = Data.endp; if (!Data.headp) { Data.headp = nodep; Data.endp = nodep; } else Data.endp -> nextp = nodep; Data.endp = nodep; nodep -> Node_Data = push_data; ++Data.List_Size; return *this; } Stack_l<Map_Type>& push(Map_Type& push_data) { Node *nodep = new Node(); nodep -> lastp = Data.endp; if (!Data.headp) { Data.headp = nodep; Data.endp = nodep; } else Data.endp -> nextp = nodep; Data.endp = nodep; nodep -> Node_Data = push_data; ++Data.List_Size; return *this; } Stack_l<Map_Type>& push(Map_Type* push_data) { Node *nodep = new Node(); nodep -> lastp = Data.endp; if (!Data.headp) { Data.headp = nodep; Data.endp = nodep; } else Data.endp -> nextp = nodep; Data.endp = nodep; nodep -> Node_Data = *push_data; ++Data.List_Size; return *this; } Stack_l<Map_Type>& push(const Map_Type* push_data) { Node *nodep = new Node(); nodep -> lastp = Data.endp; if (!Data.headp) { Data.headp = nodep; Data.endp = nodep; } else Data.endp -> nextp = nodep; Data.endp = nodep; nodep -> Node_Data = *(Map_Type*)push_data; ++Data.List_Size; return *this; } Stack_l<Map_Type>& pop(void) { if (Data.headp) { if (Data.List_Size == 1u) { delete Data.headp; Data.List_Size = 0; Data.headp = 0; Data.endp = 0; } else { Data.endp = Data.endp -> lastp; delete Data.endp -> nextp; Data.endp -> nextp = 0; --Data.List_Size; } } return *this; } Stack_l<Map_Type>& clear(void) { while (Data.List_Size) { pop(); } return *this; } Stack_l<Map_Type>(void) { /* NULL */ } Stack_l<Map_Type>(unsigned int data_size, Map_Type map_data) { Data.List_Size = data_size; while (data_size--) { Node *nodep = new Node(); nodep -> Node_Data = map_data; if (Data.headp) { nodep -> lastp = Data.endp; Data.endp -> nextp = nodep; Data.endp = nodep; } else { Data.headp = nodep; Data.endp = nodep; } } } Stack_l<Map_Type>(Stack_l<Map_Type>& map_data) { if (!map_data.empty()) { List_Data *listp = (List_Data*)map_data.data(); Node *nodep = listp -> headp, *newp; for (unsigned int i = 0; i != listp -> List_Size; ++i, nodep = nodep -> nextp) { newp = new Node(); newp -> Node_Data = nodep -> Node_Data; if (Data.headp) { newp -> lastp = Data.endp; Data.endp -> nextp = newp; Data.endp = newp; } else { Data.headp = newp; Data.endp = newp; } } Data.List_Size = listp -> List_Size; } } Stack_l<Map_Type>& operator=(Stack_l<Map_Type>& copy_data) { if (copy_data.empty()) return *this; List_Data *listp = (List_Data*)copy_data.data(); Node *nodep = listp -> headp, *newp; for (unsigned int i = 0; i != listp -> List_Size; ++i, nodep = nodep -> nextp) { newp = new Node(); newp -> Node_Data = nodep -> Node_Data; if (Data.headp) { newp -> lastp = Data.endp; Data.endp -> nextp = newp; Data.endp = newp; } else { Data.headp = newp; Data.endp = newp; } } Data.List_Size = listp -> List_Size; return *this; } bool operator==(Stack_l<Map_Type>& cmp_data) { if (cmp_data.size() != Data.List_Size) return false; else if (cmp_data.empty() && (!Data.List_Size)) return true; Node *nodep1 = Data.headp, *nodep2 = ((List_Data*)cmp_data.data()) ->headp; for (unsigned int i = 0; i != Data.List_Size; ++i, nodep1 = nodep1 -> nextp, nodep2 = nodep2 ->nextp) { if (nodep1 -> Node_Data != nodep2 -> Node_Data) return false; } return true; } bool operator!=(Stack_l<Map_Type>& cmp_data) { if (cmp_data.size() == Data.List_Size) return false; else if (cmp_data.empty() && (!Data.List_Size)) return false; Node *nodep1 = Data.headp, *nodep2 = ((List_Data*)cmp_data.data()) ->headp; for (unsigned int i = 0; i != Data.List_Size; ++i, nodep1 = nodep1 -> nextp, nodep2 = nodep2 ->nextp) { if (nodep1 -> Node_Data != nodep2 -> Node_Data) return true; } return true; } ~Stack_l<Map_Type>(void) { clear(); } }; /* Stack _ List */ template <typename Map_Type> class Stack_v /* Stack _ Vector */ { private: struct Node { Map_Type Node_Data; Node *nextp, *lastp; Node(void) { nextp = 0; lastp = 0; } }; struct List_Data { unsigned int List_Size; Node *headp, *endp; List_Data(void) { List_Size = 0; headp = 0; endp = 0; } }; struct Vector_Data { Map_Type *headp, *lastp, *endp; void resize(unsigned int data_size) { Map_Type *newp = new Map_Type[data_size](); endp = newp + data_size - 1; lastp = newp + (data_size > lastp - headp ? lastp - headp : data_size); if (headp) delete[] headp; headp = newp; } Vector_Data(void) { headp = 0; lastp = 0; endp = 0; } }Data; public: unsigned int size(void) { return Data.lastp - Data.headp; } Map_Type& top(void) { return *(Data.lastp - 1); } void* data(void) { return &Data; } bool full(void) { if (!Data.headp) return true; return Data.endp + 1 == Data.lastp; } bool empty(void) { if (!Data.headp) return true; return Data.headp == Data.lastp; } Stack_v<Map_Type>& push(Map_Type push_data) { if (full()) Data.resize((unsigned int)((Data.lastp - Data.headp) * 1.5) + 1); *Data.lastp = push_data; ++Data.lastp; return *this; } Stack_v<Map_Type>& push(Map_Type& push_data) { if (full()) Data.resize((unsigned int)((Data.lastp - Data.headp) * 1.5) + 1); *Data.lastp = push_data; ++Data.lastp; return *this; } Stack_v<Map_Type>& push(Map_Type* push_data) { if (full()) Data.resize((unsigned int)((Data.lastp - Data.headp) * 1.5) + 1); *Data.lastp = *push_data; ++Data.lastp; return *this; } Stack_v<Map_Type>& push(const Map_Type* push_data) { if (full()) Data.resize((unsigned int)((Data.lastp - Data.headp) * 1.5) + 1); *Data.lastp = *(Map_Type*)push_data; ++Data.lastp; return *this; } Stack_v<Map_Type>& pop(void) { if (empty()) { if (Data.lastp - Data.headp > 1) Data.resize((Data.lastp - Data.headp) >> 1); else return *this; } else --Data.lastp; return *this; } Stack_v<Map_Type>(void) { /* NULL */ } Stack_v<Map_Type>(unsigned int data_size, Map_Type map_data) { while (data_size) { push(&map_data); --data_size; } } Stack_v<Map_Type>(Stack_v<Map_Type>& map_data) { Vector_Data *datap = (Vector_Data*)map_data.data(); for (unsigned int i = 0, k = map_data.size(); i != k; ++i) push(datap -> headp + i); } Stack_v<Map_Type>& operator=(Stack_v<Map_Type>& copy_data) { if (copy_data.empty()) clear(); else { Vector_Data *datap = (Vector_Data*)copy_data.data(); for (unsigned int i = 0, k = copy_data.size(); i != k; ++i) push(datap -> headp + i); } return *this; } bool operator==(Stack_v<Map_Type>& cmp_data) { if (size() != cmp_data.size()) return false; else if (empty() && cmp_data.empty()) return true; Vector_Data *datap = (Vector_Data*)cmp_data.data(); for (unsigned int i = 0, k = size(); i != k; ++i) { if (*(Data.headp + i) != *(datap ->headp + i)) return false; } return true; } bool operator!=(Stack_v<Map_Type>& cmp_data) { if (size() != cmp_data.size()) return true; else if (empty() && cmp_data.empty()) return false; Vector_Data *datap = (Vector_Data*)cmp_data.data(); for (unsigned int i = 0, k = size(); i != k; ++i) { if (*(Data.headp + i) != *(datap -> headp + i)) return true; } return false; } Stack_v<Map_Type>& clear(void) { delete[] Data.headp; Data.headp = 0; Data.lastp = 0; Data.endp = 0; return *this; } ~Stack_v<Map_Type>(void) { delete[] Data.headp; } }; /* Stack _ Vector */ int main(void) { return 0; } (22029-xys)
|
11ms |
6.8 MiB |
|
196 Bytes |
2023-6-10 9:52:19 |
|
(张洛诚)
|
11ms |
512 KiB |
|
216 Bytes |
2023-4-17 20:17:21 |
|
汤杰尧 (05c05-tjy1)
|
12ms |
440 KiB |
|
208 Bytes |
2023-2-16 16:30:21 |
|
你猜呀
|
12ms |
6.9 MiB |
|
200 Bytes |
2023-9-10 10:34:50 |
|
张梓浩 (zhangzihao)
|
12ms |
6.8 MiB |
|
220 Bytes |
2023-10-7 22:01:55 |
|
ttt123
|
12ms |
6.7 MiB |
|
207 Bytes |
2023-6-10 9:05:18 |
|
希蒙 (zhengxingya)
|
12ms |
6.7 MiB |
|
292 Bytes |
2023-9-9 8:50:27 |
|
zcx
|
12ms |
6.7 MiB |
|
175 Bytes |
2023-6-7 20:12:36 |
|
经常消失 (小萝卜)
|
12ms |
384 KiB |
|
249 Bytes |
2022-6-30 13:45:00 |
|
火星伞宾——刘晏恺 (刘晏恺)
|
12ms |
6.9 MiB |
|
191 Bytes |
2023-7-23 15:38:13 |
|
ywh
|
12ms |
392 KiB |
|
207 Bytes |
2022-6-30 13:44:00 |
|
芒苒忧 (廖迦南)
|
12ms |
396 KiB |
|
393 Bytes |
2022-6-25 9:56:33 |
|
Randy Marsh (杨子腾)
|
12ms |
384 KiB |
|
209 Bytes |
2022-5-22 10:57:16 |
|
郑之策
|
12ms |
512 KiB |
|
208 Bytes |
2022-5-22 11:09:46 |
|
朱老师 (zyp)
|
12ms |
384 KiB |
|
197 Bytes |
2022-7-25 19:19:46 |
|
tyx_9192596
|
12ms |
440 KiB |
|
195 Bytes |
2023-3-16 8:00:54 |
|
陈杰晟
|
12ms |
384 KiB |
|
217 Bytes |
2022-5-13 15:13:27 |
|
22029-lsl
|
12ms |
6.7 MiB |
|
190 Bytes |
2023-6-10 9:05:42 |
|
yyds (杨骐嘉)
|
12ms |
6.9 MiB |
|
247 Bytes |
2023-8-16 18:15:28 |
|
文硕 (文硕1)
|
13ms |
384 KiB |
|
229 Bytes |
2022-7-12 13:52:57 |
|
郑之策
|
13ms |
384 KiB |
|
208 Bytes |
2022-5-22 11:09:43 |
|
在线销售纯洁晟!!!
|
13ms |
384 KiB |
|
229 Bytes |
2022-6-30 13:44:14 |
|
郑之策
|
13ms |
384 KiB |
|
208 Bytes |
2022-5-22 11:09:38 |
|
李树崑 (lishukun)
|
13ms |
384 KiB |
|
304 Bytes |
2022-6-30 13:43:52 |
|
赵泳鑫 (zhaoyongxin)
|
13ms |
432 KiB |
|
229 Bytes |
2022-4-27 19:40:39 |
|
章愉霖
|
13ms |
6.8 MiB |
|
199 Bytes |
2023-6-15 14:27:18 |
|
某某某
|
13ms |
392 KiB |
|
190 Bytes |
2022-7-1 15:51:31 |
|
22029-zjs
|
13ms |
6.7 MiB |
|
164 Bytes |
2023-6-4 12:41:41 |
|
11111
|
13ms |
384 KiB |
|
283 Bytes |
2022-3-27 16:51:04 |
|
任童(rentong)
|
13ms |
384 KiB |
|
237 Bytes |
2022-6-25 16:20:27 |
|
陈骏洋
|
13ms |
392 KiB |
|
172 Bytes |
2022-5-22 11:12:00 |
|
zhouzipu
|
13ms |
384 KiB |
|
329 Bytes |
2022-8-17 15:41:07 |
|
chenyifei
|
13ms |
384 KiB |
|
211 Bytes |
2022-5-12 20:15:42 |
|
zhangyh (张育菡)
|
13ms |
436 KiB |
|
250 Bytes |
2022-6-12 15:10:52 |
|
呵呵呵
|
13ms |
6.8 MiB |
|
186 Bytes |
2023-6-28 19:24:57 |
|
yang
|
13ms |
384 KiB |
|
339 Bytes |
2022-9-9 8:18:49 |
|
赵泳鑫 (zhaoyongxin)
|
13ms |
384 KiB |
|
229 Bytes |
2022-4-21 20:27:03 |
|
陈骏洋
|
13ms |
384 KiB |
|
172 Bytes |
2022-5-22 11:12:10 |
|
刘锦航
|
13ms |
384 KiB |
|
207 Bytes |
2022-5-12 20:13:55 |
|
Jose (反恐皮蛋)
|
13ms |
384 KiB |
|
233 Bytes |
2022-2-4 10:51:29 |
|
赵一嵘 (zhaoyirong)
|
13ms |
388 KiB |
|
229 Bytes |
2022-6-30 13:44:47 |
|
RanHao
|
13ms |
6.9 MiB |
|
249 Bytes |
2023-8-9 11:24:45 |
|
luoluonuoya
|
13ms |
384 KiB |
|
204 Bytes |
2022-6-23 19:55:46 |
|
xiongxinyao
|
13ms |
512 KiB |
|
281 Bytes |
2022-7-1 9:36:25 |
|
侯治鋆
|
13ms |
444 KiB |
|
241 Bytes |
2022-7-15 10:29:50 |
|
本人天生贪生pass (05c41-cqs)
|
13ms |
384 KiB |
|
264 Bytes |
2022-11-6 12:31:18 |
|
chenfan
|
14ms |
384 KiB |
|
208 Bytes |
2022-6-19 9:47:33 |
|
laoyang
|
14ms |
512 KiB |
|
212 Bytes |
2022-5-26 19:25:08 |
|
zhm123
|
14ms |
384 KiB |
|
200 Bytes |
2022-12-26 18:01:25 |
|
你爹 (郭铠嘉)
|
14ms |
512 KiB |
|
198 Bytes |
2022-5-22 11:12:11 |
|
王乐仪
|
14ms |
392 KiB |
|
183 Bytes |
2022-2-4 14:03:05 |
|
zhangheyi22006
|
14ms |
384 KiB |
|
183 Bytes |
2022-11-6 19:14:11 |
|
偽艺術家 (chenyanchi22006)
|
14ms |
384 KiB |
|
212 Bytes |
2022-11-6 19:11:16 |
|
luosifu22006
|
14ms |
384 KiB |
|
204 Bytes |
2022-11-6 19:16:41 |
|
12345
|
14ms |
444 KiB |
|
288 Bytes |
2022-8-3 17:08:44 |
|
杜是贤 (dushixian)
|
14ms |
512 KiB |
|
200 Bytes |
2022-7-2 11:07:08 |
|
陈杰晟
|
14ms |
384 KiB |
|
228 Bytes |
2022-6-30 13:43:51 |