|
Mr_D
|
14ms |
392 KiB |
|
140 Bytes |
2023-5-2 17:44:29 |
|
曹埊睿 (caodirui)
|
14ms |
384 KiB |
|
164 Bytes |
2023-5-2 22:54:39 |
|
wuzhenghan
|
14ms |
512 KiB |
|
165 Bytes |
2022-11-5 20:12:29 |
|
zhangheyi22006
|
14ms |
384 KiB |
|
171 Bytes |
2022-11-13 11:52:48 |
|
时代2校+施皓宬 (shihaocheng)
|
14ms |
384 KiB |
|
151 Bytes |
2023-4-22 17:41:10 |
|
中岛敦 (黄麒瑞)
|
14ms |
6.8 MiB |
|
160 Bytes |
2023-10-3 11:25:48 |
|
罗晨睿 (luochenrui)
|
14ms |
512 KiB |
|
151 Bytes |
2022-6-29 13:23:45 |
|
黄立信
|
14ms |
6.8 MiB |
|
181 Bytes |
2023-10-14 13:33:47 |
|
xzf
|
14ms |
6.7 MiB |
|
247 Bytes |
2023-9-24 16:42:25 |
|
朱老师 (zyp)
|
14ms |
436 KiB |
|
175 Bytes |
2022-8-6 11:02:36 |
|
张峻尘 (zjc)
|
14ms |
384 KiB |
|
156 Bytes |
2022-3-12 13:39:40 |
|
22029-zjs
|
14ms |
512 KiB |
|
183 Bytes |
2022-12-5 20:58:28 |
|
黄梓桐 (HuangZiTong)
|
14ms |
436 KiB |
|
152 Bytes |
2022-7-15 17:15:09 |
|
zzl
|
14ms |
6.8 MiB |
|
156 Bytes |
2023-11-7 0:36:30 |
|
Randy Marsh (杨子腾)
|
14ms |
428 KiB |
|
220 Bytes |
2022-9-17 13:05:36 |
|
新壹街校区-周士杰 (zsj)
|
14ms |
6.9 MiB |
|
145 Bytes |
2023-9-9 20:04:38 |
|
yanglang
|
14ms |
384 KiB |
|
148 Bytes |
2022-10-22 21:26:48 |
|
李彭 宋代诗人 (ljy123456)
|
14ms |
428 KiB |
|
170 Bytes |
2023-4-11 21:00:43 |
|
王乐仪
|
14ms |
432 KiB |
|
158 Bytes |
2022-2-5 14:54:40 |
|
手搓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)
|
14ms |
512 KiB |
|
185 Bytes |
2022-12-4 16:37:05 |
|
无尽的想象 (谭仕高)
|
14ms |
492 KiB |
|
180 Bytes |
2022-7-27 16:57:10 |
|
缥 (王硕2012)
|
14ms |
416 KiB |
|
170 Bytes |
2022-11-27 11:24:14 |
|
繁星 (05c35-zzm)
|
14ms |
384 KiB |
|
178 Bytes |
2022-10-29 15:44:58 |
|
彭嘉豪 (pengjiahao)
|
14ms |
440 KiB |
|
154 Bytes |
2022-7-28 10:32:56 |
|
luoluonuoya
|
14ms |
440 KiB |
|
152 Bytes |
2022-8-29 14:44:13 |
|
新壹街校区--税崇峻 (税崇峻)
|
14ms |
6.9 MiB |
|
146 Bytes |
2023-8-17 14:23:49 |
|
zhm123
|
15ms |
512 KiB |
|
179 Bytes |
2022-12-16 14:04:58 |
|
任瑞 的 学生 (jiangyadong)
|
15ms |
392 KiB |
|
204 Bytes |
2022-6-19 11:38:45 |
|
Nico
|
15ms |
512 KiB |
|
180 Bytes |
2023-5-20 14:18:08 |
|
chaikexu
|
15ms |
512 KiB |
|
167 Bytes |
2022-12-3 20:32:00 |
|
xxteacher
|
15ms |
440 KiB |
|
211 Bytes |
2022-2-15 15:12:36 |
|
煞笔笔
|
15ms |
7.3 MiB |
|
153 Bytes |
2024-1-18 10:54:13 |
|
爱琴海校区-刁钲洋 (刁钲洋)
|
15ms |
7 MiB |
|
269 Bytes |
2023-7-10 11:41:37 |
|
我推的乱破 (贺俊楠)
|
15ms |
6.9 MiB |
|
160 Bytes |
2023-6-29 22:46:39 |
|
张玉坚 (zhangyuian)
|
15ms |
384 KiB |
|
171 Bytes |
2022-12-18 14:35:30 |
|
11451254188 (22029-mjh)
|
15ms |
512 KiB |
|
195 Bytes |
2022-12-8 17:38:18 |
|
heyi
|
15ms |
6.8 MiB |
C++98(O2) |
182 Bytes |
2024-8-9 10:24:46 |
|
执剑人罗辑 (Jasson)
|
15ms |
440 KiB |
|
147 Bytes |
2023-3-25 15:08:12 |
|
新壹街校区-周士杰 (zsj)
|
15ms |
6.9 MiB |
|
145 Bytes |
2023-9-9 20:03:45 |
|
huanglu
|
15ms |
6.9 MiB |
|
180 Bytes |
2023-7-15 16:45:42 |
|
Turorany (郑浩然)
|
15ms |
7.5 MiB |
|
165 Bytes |
2023-7-10 19:00:00 |
|
zhm123
|
15ms |
436 KiB |
|
193 Bytes |
2023-4-20 13:57:26 |
|
代尚函 笛卡尔 (daishanghan)
|
15ms |
440 KiB |
|
154 Bytes |
2022-9-4 14:45:51 |
|
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)
|
15ms |
6.9 MiB |
|
166 Bytes |
2023-7-15 8:24:43 |
|
时代1校-杨宇轩 (杨宇轩)
|
15ms |
6.7 MiB |
|
148 Bytes |
2023-8-31 17:28:07 |
|
代尚函 笛卡尔 (daishanghan)
|
16ms |
384 KiB |
|
180 Bytes |
2022-12-18 14:30:33 |
|
RanHao
|
16ms |
6.9 MiB |
|
146 Bytes |
2023-7-22 11:19:10 |
|
张梓浩 (zhangzihao)
|
16ms |
6.9 MiB |
|
174 Bytes |
2023-9-9 11:05:04 |
|
22029-lyh
|
16ms |
420 KiB |
|
174 Bytes |
2023-3-23 18:54:28 |
|
wangzihang
|
16ms |
512 KiB |
|
180 Bytes |
2023-3-25 17:35:29 |
|
zcx
|
16ms |
448 KiB |
|
175 Bytes |
2022-12-8 19:10:24 |
|
(张洛诚)
|
16ms |
512 KiB |
|
183 Bytes |
2023-4-7 23:20:46 |
|
xflt_dyp
|
16ms |
6.9 MiB |
|
146 Bytes |
2023-7-22 16:56:49 |
|
dengduxi
|
16ms |
384 KiB |
|
185 Bytes |
2022-12-18 14:35:06 |
|
hrz
|
16ms |
7.3 MiB |
|
167 Bytes |
2024-1-21 14:14:54 |
|
胡宸华 (huchenhua)
|
16ms |
512 KiB |
|
210 Bytes |
2022-11-7 8:49:41 |
|
余晨浩 (yuchenhao)
|
16ms |
400 KiB |
|
171 Bytes |
2022-12-18 14:36:44 |
|
章愉霖
|
16ms |
6.8 MiB |
|
196 Bytes |
2023-6-15 14:33:13 |
|
欧俊阳
|
16ms |
6.9 MiB |
|
177 Bytes |
2023-8-21 14:07:08 |
|
廖海宇在追杀马牌痞 (liaohaiyu22031)
|
16ms |
512 KiB |
|
165 Bytes |
2023-1-7 13:29:20 |
|
ganlin1
|
16ms |
6.9 MiB |
|
155 Bytes |
2023-7-21 15:53:22 |
|
唐臣谦 (tangchenqian1)
|
16ms |
444 KiB |
|
167 Bytes |
2022-11-24 20:31:26 |
|
时代一校-赵彦博 (zyb)
|
16ms |
7 MiB |
|
175 Bytes |
2023-7-15 10:59:25 |
|
何洋名 (heyangming)
|
16ms |
6.9 MiB |
|
164 Bytes |
2023-7-5 18:31:20 |
|
龚铭俊 (哈哈哈)
|
17ms |
6.9 MiB |
|
231 Bytes |
2023-7-23 14:26:17 |
|
贾鑫豪 (Mr Sam)
|
17ms |
384 KiB |
|
150 Bytes |
2022-9-10 11:51:15 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
17ms |
512 KiB |
|
181 Bytes |
2022-9-7 19:54:26 |
|
zzzrrrxxx
|
17ms |
6.9 MiB |
|
126 Bytes |
2023-8-11 10:37:29 |
|
Tender. (05c05-zhou)
|
17ms |
444 KiB |
|
196 Bytes |
2022-10-17 20:45:52 |
|
陈风亦 (chenfengyi)
|
17ms |
432 KiB |
|
196 Bytes |
2023-1-18 17:18:06 |
|
colin1112 (墙凌可)
|
17ms |
440 KiB |
|
157 Bytes |
2023-1-22 12:41:38 |
|
Jack
|
18ms |
512 KiB |
|
150 Bytes |
2023-1-15 20:25:22 |
|
没有此人 (akm)
|
18ms |
7 MiB |
|
161 Bytes |
2023-12-23 15:11:41 |
|
刘政君 (lzj)
|
18ms |
436 KiB |
|
200 Bytes |
2022-10-21 19:47:47 |
|
希蒙 (zhengxingya)
|
18ms |
6.7 MiB |
|
240 Bytes |
2023-8-23 16:18:49 |
|
zyl
|
21ms |
7.3 MiB |
|
233 Bytes |
2024-1-4 9:45:29 |
|
贾博涵
|
23ms |
6.9 MiB |
|
146 Bytes |
2023-11-10 10:16:51 |
|
杜是贤 (dushixian)
|
23ms |
432 KiB |
|
164 Bytes |
2022-10-2 11:39:24 |
|
时代一校石博文 (shibowen)
|
23ms |
7.1 MiB |
|
151 Bytes |
2023-12-28 21:06:47 |
|
炸鱼4000+ (dxc)
|
26ms |
7.1 MiB |
|
157 Bytes |
2023-11-14 21:31:05 |
|
JOKER (hhy)
|
62ms |
760 KiB |
|
163 Bytes |
2024-2-19 19:54:37 |
|
叶哲宇 (yzy)
|
63ms |
764 KiB |
|
190 Bytes |
2024-3-23 22:19:18 |
|
赵奕铭
|
64ms |
532 KiB |
|
188 Bytes |
2024-3-24 18:32:58 |
|
梁家畅
|
66ms |
540 KiB |
C++11(O2) |
182 Bytes |
2024-11-27 20:12:05 |
|
My name is Man (钟卓劭)
|
68ms |
764 KiB |
|
163 Bytes |
2024-2-25 14:32:02 |
|
Him神
|
68ms |
764 KiB |
|
164 Bytes |
2024-2-26 14:55:24 |
|
sunxiaozhu
|
69ms |
780 KiB |
|
171 Bytes |
2024-3-20 21:11:36 |
|
JOKER (hhy)
|
69ms |
764 KiB |
|
163 Bytes |
2024-2-19 19:11:59 |
|
杨博文05
|
70ms |
532 KiB |
C++98 |
140 Bytes |
2024-9-1 12:15:34 |
|
A小涂
|
70ms |
764 KiB |
C++17(O2) |
175 Bytes |
2024-10-27 21:54:34 |
|
陈思齐
|
71ms |
780 KiB |
C++11(O2) |
150 Bytes |
2024-11-5 20:02:39 |
|
lll
|
72ms |
536 KiB |
C++98 |
232 Bytes |
2024-11-16 12:21:33 |
|
李隆西贝
|
74ms |
552 KiB |
C++11(O2) |
161 Bytes |
2024-11-22 16:47:51 |
|
金沙校区-孟熙轲 (mengxike)
|
74ms |
764 KiB |
C++98 |
184 Bytes |
2024-9-28 22:16:12 |
|
1396013295
|
91ms |
2.9 MiB |
Python 2 |
93 Bytes |
2022-1-22 17:29:39 |
|
fcxin
|
123ms |
9.4 MiB |
Python 3 |
48 Bytes |
2024-8-8 11:50:44 |
|
星野 光 (Hoshino Hikari)
|
175ms |
9.1 MiB |
Python 3 |
59 Bytes |
2023-10-23 22:08:34 |
|
高俊
|
180ms |
9.1 MiB |
Python 3 |
76 Bytes |
2023-9-24 17:32:08 |
|
猫不理包子
|
181ms |
9.1 MiB |
Python 3 |
70 Bytes |
2023-6-23 16:57:22 |
|
高俊
|
181ms |
9.1 MiB |
Python 3 |
113 Bytes |
2023-9-24 17:35:47 |