|
zyl
|
- |
7 MiB |
|
180 Bytes |
2024-1-7 10:49:03 |
|
wangjun
|
- |
6.9 MiB |
|
204 Bytes |
2023-11-29 12:18:04 |
|
喵 (蹇心悦)
|
2ms |
384 KiB |
|
219 Bytes |
2022-6-18 15:33:24 |
|
姚宏逸
|
2ms |
436 KiB |
|
237 Bytes |
2022-5-29 10:23:31 |
|
火爆肥肠(杨弘毅) (火爆肥肠)
|
2ms |
384 KiB |
|
221 Bytes |
2022-4-20 21:31:26 |
|
朱老师 (zyp)
|
2ms |
384 KiB |
|
205 Bytes |
2022-8-16 18:37:59 |
|
李树崑 (lishukun)
|
2ms |
384 KiB |
|
277 Bytes |
2022-8-3 18:06:05 |
|
panyan
|
2ms |
440 KiB |
|
224 Bytes |
2022-6-18 15:35:58 |
|
zhangyh (张育菡)
|
2ms |
436 KiB |
|
240 Bytes |
2022-6-13 22:13:43 |
|
赵沛喆
|
2ms |
412 KiB |
|
283 Bytes |
2022-5-8 11:14:26 |
|
我推的乱破 (贺俊楠)
|
2ms |
384 KiB |
|
230 Bytes |
2023-4-16 12:02:47 |
|
kim
|
2ms |
384 KiB |
|
329 Bytes |
2023-3-9 17:25:23 |
|
韩正墨 (xmw05)
|
2ms |
428 KiB |
|
192 Bytes |
2022-7-14 10:51:01 |
|
王晨志 (wangchenzhi)
|
2ms |
384 KiB |
|
226 Bytes |
2022-6-19 13:10:31 |
|
疯神芭芭脱丝 (李卓修)
|
2ms |
436 KiB |
|
245 Bytes |
2022-6-9 19:47:44 |
|
芒苒忧 (廖迦南)
|
2ms |
444 KiB |
|
274 Bytes |
2022-8-3 15:09:08 |
|
张祖名
|
3ms |
6.6 MiB |
C++98(O2) |
191 Bytes |
2024-7-6 18:35:41 |
|
陈风亦 (chenfengyi)
|
3ms |
420 KiB |
|
200 Bytes |
2022-6-18 15:33:23 |
|
时代二校-陈天成 (鸭缩毛巾)
|
3ms |
392 KiB |
|
211 Bytes |
2023-5-27 21:37:31 |
|
王韵淮
|
3ms |
384 KiB |
|
184 Bytes |
2022-6-19 9:48:07 |
|
郑岐蔚
|
3ms |
448 KiB |
|
230 Bytes |
2023-2-11 12:47:26 |
|
zhm123
|
3ms |
436 KiB |
|
195 Bytes |
2023-2-6 18:25:21 |
|
luoluonuoya
|
3ms |
436 KiB |
|
328 Bytes |
2022-3-20 15:08:57 |
|
赵泳鑫 (zhaoyongxin)
|
3ms |
432 KiB |
|
279 Bytes |
2022-4-13 20:23:06 |
|
张瑞博
|
3ms |
7 MiB |
C++11 |
262 Bytes |
2024-6-15 21:50:22 |
|
xmw318046
|
3ms |
6.6 MiB |
C++98 |
230 Bytes |
2024-7-6 17:48:56 |
|
陈杰晟
|
3ms |
444 KiB |
|
222 Bytes |
2022-2-13 12:17:41 |
|
胡宸华 (huchenhua)
|
3ms |
6.9 MiB |
|
245 Bytes |
2023-8-20 22:33:16 |
|
wangruibo20xh
|
3ms |
436 KiB |
|
164 Bytes |
2022-2-11 19:14:52 |
|
Yuan (Zongzi1)
|
3ms |
6.6 MiB |
C++17(O2) |
211 Bytes |
2024-7-21 15:46:28 |
|
huyinuo
|
3ms |
440 KiB |
|
273 Bytes |
2022-4-27 19:49:05 |
|
ycy
|
3ms |
428 KiB |
|
214 Bytes |
2022-6-29 19:30:05 |
|
肖添宇
|
3ms |
384 KiB |
|
277 Bytes |
2022-5-14 17:58:21 |
|
17779
|
3ms |
408 KiB |
|
222 Bytes |
2022-4-23 17:16:38 |
|
huanglu
|
3ms |
512 KiB |
|
294 Bytes |
2022-9-23 13:38:41 |
|
xmw318046
|
3ms |
6.5 MiB |
C++98 |
242 Bytes |
2024-7-6 17:48:10 |
|
CK (李弘毅)
|
3ms |
6.8 MiB |
|
294 Bytes |
2023-9-17 11:09:53 |
|
经常消失 (小萝卜)
|
3ms |
440 KiB |
|
216 Bytes |
2022-7-15 17:27:50 |
|
SYC0226
|
3ms |
440 KiB |
|
223 Bytes |
2022-4-10 10:41:14 |
|
曹埊睿 (caodirui)
|
3ms |
448 KiB |
|
168 Bytes |
2023-4-22 13:26:44 |
|
pandap&a王皓宸 (WANGHAOCHEN)
|
3ms |
440 KiB |
|
325 Bytes |
2023-4-30 9:19:01 |
|
scallway
|
3ms |
392 KiB |
|
210 Bytes |
2022-11-18 20:41:41 |
|
时代1校-杨宇轩 (杨宇轩)
|
3ms |
6.7 MiB |
|
307 Bytes |
2023-8-22 12:19:10 |
|
文硕 (文硕1)
|
3ms |
432 KiB |
|
279 Bytes |
2022-7-12 11:56:55 |
|
黄梓桐 (HuangZiTong)
|
3ms |
428 KiB |
|
202 Bytes |
2023-2-26 13:06:07 |
|
手搓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)
|
3ms |
6.9 MiB |
|
234 Bytes |
2023-8-13 10:35:43 |
|
爱琴海校区-黄辰浩 (huangchenhao)
|
3ms |
436 KiB |
|
176 Bytes |
2023-2-17 21:15:50 |
|
kim
|
3ms |
440 KiB |
|
329 Bytes |
2023-3-9 17:25:17 |
|
黄彦熹 (AK-203)
|
3ms |
436 KiB |
|
362 Bytes |
2023-2-26 19:48:22 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
3ms |
432 KiB |
|
194 Bytes |
2022-11-16 10:18:21 |
|
maobohan
|
3ms |
440 KiB |
|
312 Bytes |
2023-4-29 11:21:37 |
|
杜俊宏
|
3ms |
440 KiB |
|
215 Bytes |
2022-6-25 10:24:07 |
|
重庆龙湖源著校区+杨聆暄 (杨聆暄)
|
3ms |
384 KiB |
|
244 Bytes |
2023-1-19 16:49:40 |
|
林凡童 (lft)
|
3ms |
432 KiB |
|
336 Bytes |
2022-9-15 19:50:18 |
|
LUKHE (LukeHu)
|
3ms |
436 KiB |
|
286 Bytes |
2022-2-20 13:46:40 |
|
时代2校-程俊燃 (chengjunran)
|
3ms |
432 KiB |
|
200 Bytes |
2023-5-27 18:41:36 |
|
zlx (xiao)
|
3ms |
440 KiB |
|
264 Bytes |
2022-11-26 18:45:18 |
|
欧俊阳
|
3ms |
6.9 MiB |
|
201 Bytes |
2023-8-9 14:36:56 |
|
Tender. (05c05-zhou)
|
3ms |
6.7 MiB |
|
321 Bytes |
2023-8-24 10:31:19 |
|
王义苇 (wangyiwei)
|
3ms |
436 KiB |
|
327 Bytes |
2023-2-13 20:50:16 |
|
时代二校-焦雨齐 (Angel)
|
3ms |
6.3 MiB |
|
200 Bytes |
2023-6-3 17:44:26 |
|
周琪渃
|
3ms |
380 KiB |
|
322 Bytes |
2022-12-17 19:08:16 |
|
谭懿轩 (yanyixuan)
|
3ms |
436 KiB |
|
198 Bytes |
2022-8-24 15:09:17 |
|
colin1112 (墙凌可)
|
3ms |
6.6 MiB |
|
226 Bytes |
2023-9-4 21:25:10 |
|
廖海宇在追杀马牌痞 (liaohaiyu22031)
|
3ms |
432 KiB |
|
245 Bytes |
2023-1-1 8:41:12 |
|
关博源
|
3ms |
436 KiB |
|
238 Bytes |
2023-2-27 19:53:10 |
|
胡程禹
|
3ms |
7 MiB |
|
288 Bytes |
2023-7-7 9:49:34 |
|
RanHao
|
3ms |
6.9 MiB |
|
220 Bytes |
2023-7-30 11:41:30 |
|
三差学生(尘埃蓝莓) (白佳睿)
|
3ms |
7.2 MiB |
|
321 Bytes |
2023-7-11 10:14:01 |
|
三差学生(尘埃蓝莓) (白佳睿)
|
3ms |
7.2 MiB |
|
321 Bytes |
2023-7-11 10:14:59 |
|
xuniaoyin (徐袅音)
|
8ms |
7.3 MiB |
|
231 Bytes |
2023-12-17 11:01:07 |
|
My name is Man (钟卓劭)
|
12ms |
544 KiB |
|
180 Bytes |
2024-4-6 14:47:47 |
|
Him神
|
14ms |
532 KiB |
|
201 Bytes |
2024-3-8 15:45:57 |
|
赵奕铭
|
14ms |
532 KiB |
|
200 Bytes |
2024-3-8 21:57:23 |
|
叶令子
|
15ms |
544 KiB |
C++98 |
222 Bytes |
2024-10-22 20:16:26 |
|
jdy
|
15ms |
544 KiB |
|
342 Bytes |
2024-3-10 14:28:59 |
|
22029-zjs
|
15ms |
532 KiB |
|
329 Bytes |
2024-3-4 20:42:47 |
|
stehpen_zuo
|
16ms |
532 KiB |
C++20 |
200 Bytes |
2024-9-18 15:17:09 |
|
杨坤霖 (steven)
|
35ms |
3.9 MiB |
Python 3 |
104 Bytes |
2022-8-16 17:17:24 |
|
kongql
|
35ms |
8.8 MiB |
Python 3 |
103 Bytes |
2023-7-23 14:35:50 |
|
汪致卉 (wangzh)
|
35ms |
4 MiB |
Python 3 |
155 Bytes |
2022-5-27 16:36:09 |
|
苗润昊
|
36ms |
3.8 MiB |
Python 3 |
111 Bytes |
2022-1-25 17:19:14 |
|
陈年保宁醋 (dengboren)
|
37ms |
3.9 MiB |
Python 3 |
96 Bytes |
2022-2-19 10:56:41 |
|
1396013295
|
37ms |
3.9 MiB |
Python 3 |
159 Bytes |
2022-1-23 17:41:52 |
|
杨坤霖 (steven)
|
39ms |
3.9 MiB |
Python 3 |
104 Bytes |
2022-8-16 17:17:23 |
|
11111
|
41ms |
3.9 MiB |
Python 3 |
186 Bytes |
2022-1-27 17:12:45 |
|
爱琴海校区-刁钲洋 (刁钲洋)
|
43ms |
4 MiB |
Python 3 |
87 Bytes |
2022-6-27 18:45:43 |
|
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)
|
44ms |
3.9 MiB |
Python 3 |
94 Bytes |
2023-4-23 21:22:43 |
|
梨冻亿 (wiueh)
|
44ms |
3.8 MiB |
Python 3 |
109 Bytes |
2022-1-23 18:47:44 |
|
wzzjnb2012
|
45ms |
3.8 MiB |
Python 3 |
212 Bytes |
2022-11-28 22:16:01 |
|
樊竣熠 (lft1114)
|
45ms |
3.9 MiB |
Python 3 |
155 Bytes |
2022-2-24 19:10:30 |