|
张雯皓 (zhangwenhao)
|
1ms |
384 KiB |
|
189 Bytes |
2023-2-18 9:40:32 |
|
林小博
|
1ms |
384 KiB |
|
202 Bytes |
2022-4-16 9:07:50 |
|
吴佳智 (AWM)
|
1ms |
384 KiB |
|
227 Bytes |
2023-2-4 11:13:07 |
|
陈忝锐
|
1ms |
384 KiB |
|
188 Bytes |
2022-4-19 17:48:41 |
|
低调的学霸
|
1ms |
384 KiB |
|
193 Bytes |
2022-8-17 15:51:49 |
|
杨淇瑞 (杨淇瑞29)
|
1ms |
384 KiB |
|
203 Bytes |
2023-4-16 13:09:20 |
|
低调的学霸
|
1ms |
384 KiB |
|
193 Bytes |
2022-8-17 15:51:35 |
|
wangyueru
|
1ms |
384 KiB |
|
213 Bytes |
2022-9-4 12:18:11 |
|
蒋丁非凡
|
1ms |
384 KiB |
|
208 Bytes |
2023-5-18 20:49:00 |
|
yang
|
1ms |
384 KiB |
|
189 Bytes |
2022-9-8 12:26:06 |
|
赵泳鑫 (zhaoyongxin)
|
1ms |
384 KiB |
|
190 Bytes |
2022-4-28 6:53:43 |
|
低调的学霸
|
1ms |
384 KiB |
|
193 Bytes |
2022-8-17 15:51:35 |
|
ren (陈苡心)
|
1ms |
384 KiB |
|
198 Bytes |
2023-5-7 15:41:55 |
|
pandap&a王皓宸 (WANGHAOCHEN)
|
1ms |
384 KiB |
|
137 Bytes |
2022-10-29 11:20:58 |
|
李禹衡 (liyuheng22006)
|
1ms |
384 KiB |
|
196 Bytes |
2022-10-18 20:27:37 |
|
hxb
|
1ms |
384 KiB |
|
252 Bytes |
2022-9-17 17:40:39 |
|
yang
|
1ms |
384 KiB |
|
189 Bytes |
2022-9-8 12:26:04 |
|
吴佳智 (AWM)
|
1ms |
384 KiB |
|
227 Bytes |
2023-2-4 11:13:06 |
|
我和赵梓晴之间不是一般的亲密 (fengyuanzheng)
|
1ms |
384 KiB |
|
189 Bytes |
2022-6-25 21:06:15 |
|
低调的学霸
|
1ms |
392 KiB |
|
193 Bytes |
2022-8-17 15:51:22 |
|
时代校区-刘臣原 (微笑王子)
|
1ms |
384 KiB |
|
176 Bytes |
2022-9-21 21:31:52 |
|
qwertyuiop
|
1ms |
384 KiB |
|
204 Bytes |
2022-2-18 21:20:14 |
|
蒋丁非凡
|
1ms |
384 KiB |
|
208 Bytes |
2023-5-18 20:49:00 |
|
18523558128zcn
|
1ms |
384 KiB |
|
170 Bytes |
2022-4-9 13:49:42 |
|
你爹 (郭铠嘉)
|
1ms |
384 KiB |
|
193 Bytes |
2022-5-10 21:39:23 |
|
曾子懿
|
1ms |
384 KiB |
|
210 Bytes |
2023-5-7 15:32:59 |
|
李奕霖 (liyilin233)
|
1ms |
384 KiB |
|
208 Bytes |
2022-4-9 18:59:14 |
|
dengzhijie
|
1ms |
384 KiB |
|
194 Bytes |
2022-9-3 14:55:58 |
|
§范马 · 猫羽雫™☠ (lixiaoxiang22031)
|
1ms |
384 KiB |
|
167 Bytes |
2022-9-22 20:15:46 |
|
蒋丁非凡
|
1ms |
384 KiB |
|
208 Bytes |
2023-5-18 20:48:57 |
|
蒋丁非凡
|
1ms |
384 KiB |
|
208 Bytes |
2023-5-18 20:49:01 |
|
蒋丁非凡
|
1ms |
384 KiB |
|
208 Bytes |
2023-5-18 20:49:01 |
|
王若衡 (wangruoheng)
|
1ms |
384 KiB |
|
203 Bytes |
2023-4-14 21:36:00 |
|
李山水
|
1ms |
384 KiB |
|
226 Bytes |
2022-2-16 17:46:16 |
|
蒋丁非凡
|
1ms |
384 KiB |
|
208 Bytes |
2023-5-18 20:48:57 |
|
§范马 · 猫羽雫™☠ (lixiaoxiang22031)
|
1ms |
384 KiB |
|
167 Bytes |
2022-9-22 20:15:45 |
|
陈秋石
|
1ms |
384 KiB |
|
243 Bytes |
2022-2-13 12:18:45 |
|
李晨希
|
1ms |
384 KiB |
|
193 Bytes |
2023-3-4 11:22:52 |
|
赵一嵘 (zhaoyirong)
|
1ms |
384 KiB |
|
224 Bytes |
2022-4-16 15:43:13 |
|
时代二校-焦雨齐 (Angel)
|
1ms |
364 KiB |
|
207 Bytes |
2023-2-11 17:50:48 |
|
tyx_9192596
|
1ms |
432 KiB |
|
122 Bytes |
2023-3-18 20:12:34 |
|
尹浩宁2077
|
1ms |
384 KiB |
|
159 Bytes |
2022-7-10 14:35:00 |
|
叶哲宇 (yzy)
|
1ms |
6.8 MiB |
|
204 Bytes |
2023-6-23 11:06:18 |
|
你猜呀
|
1ms |
384 KiB |
|
207 Bytes |
2023-2-8 19:28:28 |
|
李玥漪
|
1ms |
384 KiB |
|
200 Bytes |
2022-2-24 20:55:10 |
|
黄泓翔
|
1ms |
384 KiB |
|
213 Bytes |
2022-10-23 14:48:48 |
|
爱琴海校区-刁钲洋 (刁钲洋)
|
1ms |
384 KiB |
|
189 Bytes |
2022-9-19 20:05:13 |
|
低调的学霸
|
1ms |
384 KiB |
|
193 Bytes |
2022-8-17 15:51:47 |
|
黄相茗
|
1ms |
384 KiB |
|
228 Bytes |
2022-4-6 20:58:59 |
|
zhoulinjun
|
1ms |
384 KiB |
|
205 Bytes |
2023-1-1 18:01:34 |
|
蒋丁非凡
|
1ms |
384 KiB |
|
208 Bytes |
2023-5-18 20:48:57 |
|
蒋丁非凡
|
1ms |
384 KiB |
|
208 Bytes |
2023-5-18 20:49:00 |
|
高致远 (GZY)
|
1ms |
384 KiB |
|
221 Bytes |
2023-2-12 20:39:01 |
|
A小涂
|
1ms |
6.5 MiB |
|
208 Bytes |
2023-8-31 19:53:50 |
|
低调的学霸
|
1ms |
384 KiB |
|
193 Bytes |
2022-8-17 15:51:35 |
|
低调的学霸
|
1ms |
384 KiB |
|
193 Bytes |
2022-8-17 15:51:45 |
|
某某某
|
1ms |
384 KiB |
|
192 Bytes |
2022-4-16 15:45:13 |
|
WangXi
|
1ms |
384 KiB |
|
200 Bytes |
2022-8-27 19:02:14 |
|
§范马 · 猫羽雫™☠ (lixiaoxiang22031)
|
1ms |
384 KiB |
|
167 Bytes |
2022-9-22 20:15:46 |
|
zhuqiwei22006
|
1ms |
392 KiB |
|
195 Bytes |
2022-5-1 18:53:25 |
|
tangshangjie12345
|
1ms |
384 KiB |
|
179 Bytes |
2023-5-14 15:50:39 |
|
低调的学霸
|
1ms |
384 KiB |
|
193 Bytes |
2022-8-17 15:51:46 |
|
1 (秦子栋)
|
1ms |
384 KiB |
|
196 Bytes |
2023-5-7 15:42:06 |
|
罗翊宸
|
1ms |
6.8 MiB |
|
186 Bytes |
2023-9-2 11:19:49 |
|
呵呵呵 (陈思琦)
|
1ms |
384 KiB |
|
208 Bytes |
2022-6-12 9:14:45 |
|
yuanminghong
|
1ms |
392 KiB |
|
193 Bytes |
2023-1-1 18:19:07 |
|
洛谷:AIDczy(uid:656765) (chenzeyu)
|
1ms |
384 KiB |
|
193 Bytes |
2022-4-9 19:04:46 |
|
梨冻亿 (wiueh)
|
1ms |
384 KiB |
|
193 Bytes |
2022-2-19 9:01:01 |
|
蒋丁非凡
|
1ms |
384 KiB |
|
208 Bytes |
2023-5-18 20:48:57 |
|
§范马 · 猫羽雫™☠ (lixiaoxiang22031)
|
1ms |
384 KiB |
|
167 Bytes |
2022-9-22 20:15:45 |
|
蒋丁非凡
|
1ms |
380 KiB |
|
208 Bytes |
2023-5-18 20:49:00 |
|
时代一校 - 冯隆浩 (冯隆浩)
|
1ms |
384 KiB |
|
198 Bytes |
2022-10-22 19:14: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)
|
1ms |
384 KiB |
|
220 Bytes |
2023-5-20 11:32:48 |
|
ywh
|
1ms |
384 KiB |
|
206 Bytes |
2022-4-16 11:22:31 |
|
低调的学霸
|
1ms |
384 KiB |
|
193 Bytes |
2022-8-17 15:51:48 |
|
yiqiuyu
|
1ms |
384 KiB |
|
189 Bytes |
2023-4-22 16:26:50 |
|
lichengrui23003
|
1ms |
384 KiB |
|
234 Bytes |
2023-2-4 18:13:25 |
|
蒋丁非凡
|
1ms |
384 KiB |
|
208 Bytes |
2023-5-18 20:48:57 |
|
郑岐蔚
|
1ms |
384 KiB |
|
199 Bytes |
2022-9-5 20:40:56 |
|
陈思彤
|
1ms |
384 KiB |
|
198 Bytes |
2023-5-7 15:49:55 |
|
何星震 (Jacob)
|
1ms |
360 KiB |
|
189 Bytes |
2022-9-30 21:26:57 |
|
jiangjc
|
1ms |
384 KiB |
|
186 Bytes |
2023-5-28 15:33:16 |
|
啊...这 (炼狱杏寿郎)
|
1ms |
384 KiB |
|
203 Bytes |
2022-4-16 15:41:56 |
|
蒋丁非凡
|
1ms |
384 KiB |
|
208 Bytes |
2023-5-18 20:49:00 |
|
11111
|
1ms |
400 KiB |
|
177 Bytes |
2022-2-20 11:29:27 |
|
靳博然 (jbr)
|
1ms |
384 KiB |
C++ |
223 Bytes |
2022-9-3 14:52:11 |
|
顶尖轩崽
|
1ms |
384 KiB |
|
231 Bytes |
2022-9-3 14:31:51 |
|
刘锦航
|
1ms |
384 KiB |
|
186 Bytes |
2022-8-26 19:50:27 |
|
ddz
|
1ms |
384 KiB |
|
213 Bytes |
2022-6-19 16:36:34 |
|
低调的学霸
|
1ms |
384 KiB |
|
193 Bytes |
2022-8-17 15:51:44 |
|
蒋丁非凡
|
1ms |
384 KiB |
|
208 Bytes |
2023-5-18 20:49:00 |
|
蒋丁非凡
|
1ms |
384 KiB |
|
208 Bytes |
2023-5-18 20:48:51 |
|
六 (江智昕)
|
1ms |
376 KiB |
|
195 Bytes |
2022-10-29 11:28:16 |
|
蒋丁非凡
|
1ms |
380 KiB |
|
208 Bytes |
2023-5-18 20:49:01 |
|
低调的学霸
|
1ms |
392 KiB |
|
193 Bytes |
2022-8-17 15:51:48 |
|
金沙校区-王俊元 (王俊元)
|
1ms |
6.8 MiB |
|
191 Bytes |
2023-9-2 11:18:29 |
|
蒋丁非凡
|
1ms |
384 KiB |
|
208 Bytes |
2023-5-18 20:48:56 |
|
ren (陈苡心)
|
1ms |
384 KiB |
|
198 Bytes |
2023-5-7 15:41:54 |
|
蒲梓勋 (puzixun)
|
1ms |
384 KiB |
|
230 Bytes |
2022-7-15 18:15:52 |
|
Tang
|
1ms |
384 KiB |
|
223 Bytes |
2022-2-26 10:21:26 |