|
HIMMZXC
|
7ms |
384 KiB |
|
290 Bytes |
2022-3-19 14:08:00 |
|
疯神芭芭脱丝 (李卓修)
|
7ms |
392 KiB |
|
249 Bytes |
2022-1-24 11:16:12 |
|
luosifu22006
|
7ms |
436 KiB |
|
146 Bytes |
2022-9-4 13:13:43 |
|
章愉霖
|
7ms |
436 KiB |
|
243 Bytes |
2023-6-1 11:05:51 |
|
希蒙 (zhengxingya)
|
7ms |
6.9 MiB |
|
255 Bytes |
2023-8-15 14:10:17 |
|
hnd (陈皓洋)
|
7ms |
392 KiB |
|
156 Bytes |
2022-11-16 21:19:21 |
|
x0l0x
|
7ms |
6.7 MiB |
|
196 Bytes |
2023-10-1 9:04:13 |
|
陈雨泽1
|
7ms |
440 KiB |
|
229 Bytes |
2023-2-18 11:09:23 |
|
向俊熙 (xiangjunxi23003)
|
7ms |
6.9 MiB |
|
191 Bytes |
2023-7-28 15:39:19 |
|
冒牌陈杰晟【MOD】 (wed)
|
7ms |
384 KiB |
|
146 Bytes |
2022-2-26 16:06:45 |
|
洛阳 锦程 (郭思利)
|
7ms |
7.1 MiB |
C++98 |
180 Bytes |
2024-5-19 9:50:36 |
|
曹雅萱
|
7ms |
6.9 MiB |
C++11 |
241 Bytes |
2024-8-23 19:58:06 |
|
源著校区 陈锐霖 (13983855850)
|
7ms |
6.8 MiB |
C++11 |
179 Bytes |
2024-8-14 11:25:56 |
|
曹埊睿 (caodirui)
|
7ms |
440 KiB |
|
179 Bytes |
2023-5-1 21:57:50 |
|
时代一校-曾科智 (曾科智)
|
7ms |
436 KiB |
|
229 Bytes |
2023-2-25 19:43:44 |
|
56 (13883454928)
|
7ms |
6.7 MiB |
|
184 Bytes |
2023-8-26 11:00:16 |
|
陈杰晟
|
7ms |
436 KiB |
|
197 Bytes |
2022-2-22 13:17:06 |
|
肖添宇
|
7ms |
392 KiB |
|
254 Bytes |
2022-1-22 20:31:56 |
|
钟睿煊 (zhongruixuan)
|
7ms |
6.8 MiB |
|
146 Bytes |
2023-7-16 14:01:33 |
|
刘骏峰1
|
7ms |
6.9 MiB |
C++98 |
166 Bytes |
2024-8-25 10:19:26 |
|
444444444 (唐跃元)
|
7ms |
384 KiB |
|
174 Bytes |
2023-2-25 13:49:49 |
|
SYC0226
|
7ms |
384 KiB |
|
209 Bytes |
2022-3-20 11:01:51 |
|
人间理想小俗气
|
7ms |
388 KiB |
|
232 Bytes |
2022-1-26 18:34:17 |
|
何星震 (Jacob)
|
7ms |
440 KiB |
|
194 Bytes |
2023-2-5 9:23:35 |
|
时代一校 蒋帛希 (13983392730)
|
7ms |
392 KiB |
|
185 Bytes |
2023-5-30 20:45:17 |
|
曹烜豪
|
7ms |
412 KiB |
|
162 Bytes |
2023-3-18 20:03:36 |
|
苏信泽
|
7ms |
384 KiB |
|
153 Bytes |
2023-3-18 19:58:07 |
|
yxj
|
7ms |
436 KiB |
|
182 Bytes |
2022-10-20 15:43:05 |
|
贾鑫豪 (Mr Sam)
|
7ms |
432 KiB |
|
172 Bytes |
2022-3-3 6:45:29 |
|
05c05-zjk
|
7ms |
444 KiB |
|
231 Bytes |
2023-2-19 15:23:19 |
|
葛琮扬
|
7ms |
384 KiB |
|
201 Bytes |
2022-2-8 15:42:34 |
|
我推的乱破 (贺俊楠)
|
7ms |
384 KiB |
|
226 Bytes |
2023-5-28 12:34:13 |
|
heyuzhe
|
7ms |
6.8 MiB |
C++98 |
174 Bytes |
2024-8-15 18:23:10 |
|
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)
|
7ms |
392 KiB |
|
164 Bytes |
2023-3-26 18:02:22 |
|
纪承熙
|
7ms |
440 KiB |
|
204 Bytes |
2022-2-19 20:24:32 |
|
火爆肥肠(杨弘毅) (火爆肥肠)
|
7ms |
440 KiB |
|
202 Bytes |
2022-3-9 21:12:52 |
|
傅博涛
|
7ms |
392 KiB |
|
192 Bytes |
2022-1-22 10:59:48 |
|
yezhiheng
|
7ms |
428 KiB |
|
217 Bytes |
2022-1-16 11:05:52 |
|
ganlin1
|
7ms |
6.9 MiB |
|
158 Bytes |
2023-7-17 14:19:50 |
|
源著校区-宋昊成 (马冬梅)
|
7ms |
436 KiB |
|
230 Bytes |
2023-2-25 18:10:20 |
|
张祖名
|
7ms |
6.7 MiB |
|
172 Bytes |
2023-9-5 19:42:24 |
|
张梓辰 (DiaoDesi屌德斯)
|
7ms |
432 KiB |
|
200 Bytes |
2022-9-14 19:34:40 |
|
wangxingyue
|
7ms |
440 KiB |
|
148 Bytes |
2023-3-28 18:57:55 |
|
22029-hqh
|
7ms |
512 KiB |
|
172 Bytes |
2022-11-5 11:13:00 |
|
huangkaixin
|
7ms |
400 KiB |
|
132 Bytes |
2022-9-3 16:17:31 |
|
田雨杨 (tianyuyang23010)
|
7ms |
6.9 MiB |
C++98 |
177 Bytes |
2024-8-23 14:31:02 |
|
文硕 (文硕1)
|
7ms |
444 KiB |
|
194 Bytes |
2022-2-6 13:47:03 |
|
草||草 (陈星佑)
|
7ms |
420 KiB |
|
136 Bytes |
2022-10-28 17:33:30 |
|
新壹街-曾浩坤 (曾浩坤)
|
7ms |
6.8 MiB |
|
180 Bytes |
2023-9-30 10:33:30 |
|
yanglang
|
7ms |
432 KiB |
|
164 Bytes |
2022-10-22 16:28:47 |
|
手搓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)
|
7ms |
384 KiB |
|
206 Bytes |
2022-11-5 11:29:38 |
|
中岛敦 (黄麒瑞)
|
7ms |
6.7 MiB |
|
226 Bytes |
2023-9-30 21:35:18 |
|
邬文博 (wwb)
|
7ms |
384 KiB |
|
161 Bytes |
2023-4-16 11:54:06 |
|
05c30-dyh
|
7ms |
440 KiB |
|
184 Bytes |
2022-2-26 13:32:41 |
|
宋金龙 (songjl0421)
|
7ms |
392 KiB |
|
194 Bytes |
2022-1-22 18:13:40 |
|
一片落叶 (yeyuhao)
|
7ms |
6.7 MiB |
|
171 Bytes |
2023-8-28 20:21:07 |
|
在煎鱼的肖大总铳 (肖宇航)
|
7ms |
7 MiB |
|
188 Bytes |
2023-9-24 11:05:49 |
|
Accepted (周芷乐)
|
7ms |
7 MiB |
C++14 |
197 Bytes |
2024-6-18 11:57:30 |
|
曹元明
|
7ms |
436 KiB |
|
173 Bytes |
2022-9-3 14:04:23 |
|
程子杰 (05c41-czj)
|
7ms |
432 KiB |
|
190 Bytes |
2022-7-27 10:38:49 |
|
罗翌珂 (dangdang)
|
7ms |
436 KiB |
|
196 Bytes |
2022-8-16 19:07:31 |
|
我和赵梓晴之间不是一般的亲密 (fengyuanzheng)
|
7ms |
464 KiB |
|
183 Bytes |
2022-3-5 18:02:55 |
|
11111
|
7ms |
384 KiB |
|
255 Bytes |
2022-3-5 9:19:54 |
|
新壹街.曾祥睿 (zxr)
|
7ms |
6.8 MiB |
|
171 Bytes |
2023-9-24 17:54:29 |
|
77777777
|
7ms |
6.7 MiB |
C++17 |
185 Bytes |
2024-7-18 21:16:49 |
|
张月恒
|
7ms |
7 MiB |
C++98(O2) |
182 Bytes |
2024-5-26 18:43:42 |
|
周 子 涵
|
7ms |
412 KiB |
|
188 Bytes |
2022-10-1 15:15:12 |
|
(张洛诚)
|
7ms |
384 KiB |
|
213 Bytes |
2023-4-5 21:28:36 |
|
lyk
|
7ms |
392 KiB |
|
200 Bytes |
2022-10-18 17:46:04 |
|
第五人格启动 (罗子键)
|
7ms |
384 KiB |
|
152 Bytes |
2023-3-18 19:58:09 |
|
pandap&a王皓宸 (WANGHAOCHEN)
|
7ms |
432 KiB |
|
236 Bytes |
2022-12-28 14:20:40 |
|
胡澜之 (666hlz666)
|
7ms |
7 MiB |
|
158 Bytes |
2023-7-9 14:18:39 |
|
wangjunhan
|
7ms |
440 KiB |
|
194 Bytes |
2022-10-29 15:53:38 |
|
蒲梓勋 (puzixun)
|
7ms |
440 KiB |
|
203 Bytes |
2022-6-22 20:20:27 |
|
欧俊阳
|
7ms |
6.7 MiB |
|
187 Bytes |
2023-8-22 15:32:49 |
|
王昱祺 (12王昱祺)
|
7ms |
384 KiB |
|
223 Bytes |
2023-3-26 17:17:18 |
|
Microsoft (hu_moren)
|
7ms |
7 MiB |
C++98 |
207 Bytes |
2024-8-24 16:40:00 |
|
Nico
|
7ms |
432 KiB |
|
161 Bytes |
2023-4-16 14:38:56 |
|
何洋名 (heyangming)
|
7ms |
396 KiB |
|
161 Bytes |
2022-10-6 14:06:34 |
|
赵启程 (赵启程1)
|
7ms |
440 KiB |
|
353 Bytes |
2023-3-18 19:43:48 |
|
zyz (曾韵竹)
|
7ms |
6.9 MiB |
C++98 |
199 Bytes |
2024-8-22 13:17:47 |
|
hnd (陈皓洋)
|
7ms |
444 KiB |
|
156 Bytes |
2022-11-16 21:18:18 |
|
yqj
|
7ms |
7 MiB |
|
180 Bytes |
2023-12-28 19:04:26 |
|
我谢谢你全家
|
7ms |
436 KiB |
|
181 Bytes |
2023-3-11 13:47:06 |
|
火星伞宾——刘晏恺 (刘晏恺)
|
7ms |
6.9 MiB |
|
202 Bytes |
2023-8-15 11:15:15 |
|
时代1校-杨宇轩 (杨宇轩)
|
7ms |
6.7 MiB |
|
174 Bytes |
2023-8-31 17:21:08 |
|
苏庭毅
|
7ms |
384 KiB |
|
176 Bytes |
2023-3-18 19:58:36 |
|
xzf
|
7ms |
6.7 MiB |
|
216 Bytes |
2023-9-10 15:18:23 |
|
孙烽轶 (sfy)
|
7ms |
6.8 MiB |
|
163 Bytes |
2023-7-5 8:21:32 |
|
炸鱼4000+ (dxc)
|
7ms |
512 KiB |
|
179 Bytes |
2023-3-18 19:39:16 |
|
新壹街校区-陈琬舒 (空空大师)
|
7ms |
6.8 MiB |
|
163 Bytes |
2023-10-18 10:59:05 |
|
呵呵呵 (陈思琦)
|
7ms |
6.9 MiB |
|
148 Bytes |
2023-8-20 20:13:13 |
|
陈家齐 (陈家齐1)
|
7ms |
384 KiB |
|
148 Bytes |
2023-3-18 19:59:12 |
|
杨瀚霖 (yanghanlin)
|
7ms |
392 KiB |
|
177 Bytes |
2023-5-30 22:13:27 |
|
繁星 (05c35-zzm)
|
7ms |
436 KiB |
|
199 Bytes |
2022-11-13 9:44:35 |
|
杨淇瑞 (杨淇瑞29)
|
7ms |
6.9 MiB |
|
210 Bytes |
2023-7-17 17:49:47 |
|
胡程禹
|
7ms |
384 KiB |
|
192 Bytes |
2023-3-18 19:54:15 |
|
张泰凌 (ztl)
|
7ms |
424 KiB |
|
208 Bytes |
2022-3-19 11:18:15 |
|
江坤锜
|
7ms |
384 KiB |
|
201 Bytes |
2023-3-18 19:48:02 |
|
wzzjnb2012
|
7ms |
440 KiB |
|
221 Bytes |
2022-9-29 21:57:34 |