|
zjm
|
14ms |
512 KiB |
|
185 Bytes |
2022-11-27 14:39:23 |
|
周琪渃
|
14ms |
6.8 MiB |
|
177 Bytes |
2023-10-10 18:50:10 |
|
朱老师 (zyp)
|
14ms |
384 KiB |
|
192 Bytes |
2022-11-27 11:54:56 |
|
qwerty
|
14ms |
384 KiB |
|
157 Bytes |
2022-3-12 16:52:48 |
|
城市之光
|
14ms |
392 KiB |
|
170 Bytes |
2023-3-16 19:38:22 |
|
新壹街—熊轩杭 (xiongxuanhang)
|
14ms |
7 MiB |
|
160 Bytes |
2023-12-23 17:43:29 |
|
Ronnie
|
14ms |
512 KiB |
|
207 Bytes |
2022-2-27 10:04:59 |
|
漆星语 (qixingyu)
|
14ms |
404 KiB |
|
186 Bytes |
2023-3-11 10:58:56 |
|
荣耀
|
14ms |
6.8 MiB |
|
133 Bytes |
2023-9-9 14:03:55 |
|
执剑人罗辑 (Jasson)
|
14ms |
392 KiB |
|
146 Bytes |
2022-11-5 19:23:39 |
|
张瑞博
|
14ms |
7.2 MiB |
C++11 |
157 Bytes |
2024-4-20 23:28:41 |
|
wangruibo20xh
|
14ms |
444 KiB |
|
200 Bytes |
2022-2-11 14:23:53 |
|
时代一校-赵彦博 (zyb)
|
14ms |
6.7 MiB |
|
148 Bytes |
2023-8-24 18:51:25 |
|
许嘉恩 (xje22031)
|
14ms |
6.7 MiB |
|
150 Bytes |
2023-9-9 10:40:37 |
|
欧俊阳
|
14ms |
384 KiB |
|
141 Bytes |
2022-11-12 15:59:52 |
|
张玉坚 (zhangyuian)
|
14ms |
392 KiB |
|
145 Bytes |
2022-10-23 14:34:58 |
|
杜俊宏
|
14ms |
384 KiB |
|
235 Bytes |
2022-7-5 21:20:08 |
|
吃小孩的viv_
|
14ms |
432 KiB |
|
172 Bytes |
2023-3-16 19:27:53 |
|
葛琮扬
|
14ms |
384 KiB |
|
168 Bytes |
2022-10-22 17:47:02 |
|
zzl
|
14ms |
392 KiB |
|
158 Bytes |
2023-5-25 13:23:54 |
|
灵光sans (wangchihao)
|
14ms |
6.8 MiB |
|
145 Bytes |
2023-6-10 15:39:17 |
|
呵呵呵 (陈思琦)
|
14ms |
432 KiB |
|
148 Bytes |
2022-9-24 16:58:25 |
|
庹仕杰
|
14ms |
6.8 MiB |
|
158 Bytes |
2023-9-9 14:08:58 |
|
zhm123
|
14ms |
384 KiB |
|
156 Bytes |
2022-10-13 10:46:50 |
|
叶梓珺
|
14ms |
6.9 MiB |
|
169 Bytes |
2023-11-5 11:51:48 |
|
洛阳 锦程 (郭思利)
|
14ms |
7 MiB |
C++98 |
159 Bytes |
2024-5-26 10:49:05 |
|
刘煜轩
|
14ms |
6.7 MiB |
|
155 Bytes |
2023-9-9 9:34:07 |
|
时代1校-杨宇轩 (杨宇轩)
|
14ms |
6.9 MiB |
|
148 Bytes |
2023-8-21 14:02:38 |
|
中岛敦 (黄麒瑞)
|
14ms |
6.8 MiB |
|
165 Bytes |
2023-10-2 14:48:18 |
|
soha (武夷岩)
|
15ms |
6.8 MiB |
|
181 Bytes |
2023-6-10 15:44:27 |
|
dengduxi
|
15ms |
392 KiB |
|
151 Bytes |
2022-10-23 14:34:14 |
|
shenyushun2
|
15ms |
384 KiB |
|
186 Bytes |
2022-12-16 21:57:46 |
|
wzzjnb2012
|
15ms |
512 KiB |
|
176 Bytes |
2022-10-3 21:26:03 |
|
黄梓轩 (huangzixuan)
|
15ms |
512 KiB |
|
178 Bytes |
2022-10-1 14:26:52 |
|
何洋名 (heyangming)
|
15ms |
6.8 MiB |
|
186 Bytes |
2023-9-9 14:07:37 |
|
Tender. (05c05-zhou)
|
15ms |
444 KiB |
|
158 Bytes |
2022-10-17 20:56:49 |
|
本人天生贪生pass (05c41-cqs)
|
15ms |
392 KiB |
|
157 Bytes |
2022-10-22 17:45:57 |
|
乐瀚阳 (yuehanyang)
|
15ms |
6.8 MiB |
|
141 Bytes |
2023-6-10 15:38:58 |
|
黄立信
|
15ms |
6.8 MiB |
|
210 Bytes |
2023-10-15 13:42:47 |
|
ShenChuan
|
15ms |
6.7 MiB |
|
162 Bytes |
2023-9-9 10:42:00 |
|
郭人瑀作业号
|
15ms |
460 KiB |
|
159 Bytes |
2022-8-2 15:19:58 |
|
陈雨泽1
|
15ms |
400 KiB |
|
171 Bytes |
2023-6-3 9:20:42 |
|
手搓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)
|
15ms |
512 KiB |
|
160 Bytes |
2023-5-19 18:59:55 |
|
chen (peter)
|
15ms |
528 KiB |
|
161 Bytes |
2023-2-25 18:58:56 |
|
贺睿林
|
15ms |
6.8 MiB |
|
202 Bytes |
2023-9-9 14:02:52 |
|
明哲瀚 (18580067605)
|
15ms |
384 KiB |
|
196 Bytes |
2022-11-5 19:25:28 |
|
Error404sans (焦阳浩云)
|
15ms |
6.7 MiB |
|
160 Bytes |
2023-9-9 9:36:09 |
|
周琪渃
|
15ms |
384 KiB |
|
176 Bytes |
2022-11-10 23:14:51 |
|
我很6 (zjj22031)
|
15ms |
408 KiB |
|
146 Bytes |
2022-11-27 12:04:13 |
|
天之渺 (05c41-dd)
|
15ms |
384 KiB |
|
169 Bytes |
2022-9-11 9:50:09 |
|
22029-lyh
|
15ms |
6.9 MiB |
|
170 Bytes |
2023-8-17 16:52:04 |
|
wangyueru
|
15ms |
384 KiB |
|
197 Bytes |
2022-11-5 19:12:27 |
|
xuniaoyin (徐袅音)
|
15ms |
6.8 MiB |
|
174 Bytes |
2023-10-29 9:19:54 |
|
TBB (杜昊燃)
|
15ms |
392 KiB |
|
209 Bytes |
2022-12-14 11:26:16 |
|
源著校区-宋昊成 (马冬梅)
|
15ms |
512 KiB |
|
220 Bytes |
2023-2-25 18:24:53 |
|
许梓宸 (xuzichen)
|
15ms |
6.7 MiB |
C++17(O2) |
189 Bytes |
2024-7-17 16:15:48 |
|
新壹街校区--税崇峻 (税崇峻)
|
15ms |
6.9 MiB |
|
158 Bytes |
2023-8-8 13:56:10 |
|
周浩楠 (开朗的周好难)
|
15ms |
6.9 MiB |
|
151 Bytes |
2023-7-29 18:25:02 |
|
李山水
|
15ms |
384 KiB |
|
349 Bytes |
2022-8-26 20:11:27 |
|
yanglang
|
15ms |
384 KiB |
|
212 Bytes |
2022-10-23 10:43:52 |
|
林凡童 (lft)
|
15ms |
7 MiB |
|
167 Bytes |
2023-7-19 15:50:31 |
|
时代一校 - 冯隆浩 (冯隆浩)
|
15ms |
392 KiB |
|
215 Bytes |
2023-1-7 19:36:23 |
|
张梓浩 (zhangzihao)
|
15ms |
436 KiB |
|
151 Bytes |
2023-3-29 20:59:20 |
|
小忙果 (王昱杰)
|
15ms |
6.9 MiB |
|
176 Bytes |
2023-7-18 8:43:26 |
|
ganlin1
|
15ms |
6.9 MiB |
|
163 Bytes |
2023-7-27 9:56:02 |
|
(张洛诚)
|
15ms |
6.8 MiB |
|
196 Bytes |
2023-6-27 10:22:02 |
|
叶哲宇 (yzy)
|
15ms |
6.8 MiB |
|
152 Bytes |
2023-6-23 10:42:45 |
|
我是周靖松长得帅 (mouyunqi)
|
15ms |
512 KiB |
|
173 Bytes |
2023-3-17 18:59:31 |
|
pandap&a王皓宸 (WANGHAOCHEN)
|
15ms |
384 KiB |
|
221 Bytes |
2022-12-14 20:27:04 |
|
zry
|
16ms |
392 KiB |
|
157 Bytes |
2022-9-11 9:41:36 |
|
maobohan
|
16ms |
6.8 MiB |
|
176 Bytes |
2023-12-2 9:37:57 |
|
代尚函 笛卡尔 (daishanghan)
|
16ms |
444 KiB |
|
160 Bytes |
2022-10-23 14:22:41 |
|
刘锦航
|
16ms |
440 KiB |
|
189 Bytes |
2022-12-31 18:54:31 |
|
zyl
|
16ms |
7.3 MiB |
|
159 Bytes |
2024-1-4 10:32:17 |
|
胡程禹
|
16ms |
6.7 MiB |
|
186 Bytes |
2023-9-13 20:41:31 |
|
没有此人 (akm)
|
16ms |
7.2 MiB |
|
182 Bytes |
2023-7-3 11:47:21 |
|
爱琴海校区-刁钲洋 (刁钲洋)
|
16ms |
6.9 MiB |
|
295 Bytes |
2023-8-4 19:35:18 |
|
RanHao
|
16ms |
6.9 MiB |
|
173 Bytes |
2023-7-22 18:18:46 |
|
任童(rentong)
|
16ms |
440 KiB |
|
211 Bytes |
2022-12-16 14:14:27 |
|
colin1112 (墙凌可)
|
16ms |
444 KiB |
|
204 Bytes |
2023-3-11 15:05:43 |
|
陈杰晟
|
16ms |
384 KiB |
|
191 Bytes |
2022-9-30 20:04:57 |
|
Nico
|
16ms |
6.8 MiB |
|
216 Bytes |
2023-6-22 11:02:19 |
|
Microsoft (hu_moren)
|
16ms |
6.9 MiB |
|
229 Bytes |
2023-7-29 14:11:04 |
|
jighghjkfkhfdhdfdfdsfsdfsafvmnkbnkbmnlvnmkbvnvb;,.m;,;.;,;kbvlmkbnlmkblnvkmlbnkmlbvkmlbvklmbkmlkblmbnm;,l.,.;,'.,';.[',;.[,kjkoihgfhfgiohifgohifgohiofgihgofhiofgihofgihofgihofgiho;''[;.',m;.',m.;',.;'m,.;';'cv;x'cb'cx;b'cv;b'xc;b'c;b'cvbvc.'bv.//,/vb./vcb./cvbv,c.b,cv.,b.cv,b.vc,bg;hgl;hgl;hg;h;hfg;hl;lf;l;lxc;cln;bvln;vcln;vnl;vbl;vbln;vlv;blnvb;plnp;lplhfljpjh;nlvb;nv;bn;vcvl;nlv;nlv;g;hjhchl;ghfghl;fghl;ltlh;l;hlf;lg;bnlc;;nlv;nbv;nbv;nvb;nlvcnl;xc;blxcb;ll;hg;lhgl;dfl;t;ldy;l;lyl;rewlt493;l;dl;dsflg;lsdlpbpcxobpocvbpopopopreopotpreotertertretert (litingxu)
|
16ms |
6.9 MiB |
|
249 Bytes |
2023-8-12 15:33:22 |
|
周浩楠 (开朗的周好难)
|
16ms |
7.2 MiB |
|
151 Bytes |
2023-7-3 11:15:57 |
|
周浩楠 (开朗的周好难)
|
16ms |
6.7 MiB |
|
151 Bytes |
2023-9-9 9:28:06 |
|
郑岐蔚
|
16ms |
6.9 MiB |
|
147 Bytes |
2023-7-21 12:46:14 |
|
何昊宇 (22016-hhy)
|
16ms |
6.9 MiB |
|
151 Bytes |
2023-7-29 19:15:34 |
|
蒲梓勋 (puzixun)
|
16ms |
6.9 MiB |
|
177 Bytes |
2023-6-9 19:45:40 |
|
熊海阳 (xiongxaiyang)
|
16ms |
6.9 MiB |
|
147 Bytes |
2023-8-12 11:01:11 |
|
我是曾科智儿子 (沈小童)
|
17ms |
6.8 MiB |
|
165 Bytes |
2023-9-9 14:11:30 |
|
CK (李弘毅)
|
17ms |
384 KiB |
|
165 Bytes |
2022-9-24 15:50:29 |
|
李豪 (Hao_pp)
|
17ms |
6.8 MiB |
|
232 Bytes |
2023-11-18 0:12:07 |
|
刘政君 (lzj)
|
17ms |
512 KiB |
|
193 Bytes |
2022-10-11 21:57:39 |
|
重庆龙湖源著校区+杨聆暄 (杨聆暄)
|
17ms |
512 KiB |
|
217 Bytes |
2023-1-14 16:57:52 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
17ms |
432 KiB |
|
290 Bytes |
2022-11-16 9:30:11 |
|
拥抱幸福小熊(吴沛篪)
|
17ms |
7.1 MiB |
|
177 Bytes |
2023-11-18 11:37:37 |
|
PYMcn
|
18ms |
7 MiB |
|
169 Bytes |
2023-11-18 18:22:01 |
|
曹埊睿 (caodirui)
|
18ms |
496 KiB |
|
176 Bytes |
2023-4-18 18:57:15 |
|
wangjun
|
19ms |
7 MiB |
|
155 Bytes |
2023-11-19 15:41:03 |