|
吴俊成 (wujuncheng)
|
14ms |
428 KiB |
|
409 Bytes |
2022-7-11 11:18:02 |
|
杨浩灵 (金坷拉)
|
14ms |
436 KiB |
|
283 Bytes |
2023-1-4 23:14:18 |
|
曹埊睿 (caodirui)
|
14ms |
512 KiB |
|
345 Bytes |
2023-5-8 20:03:33 |
|
heyi
|
14ms |
6.8 MiB |
C++98(O2) |
472 Bytes |
2024-8-11 10:59:39 |
|
龙湖时代C馆-邹镇宇 (邹镇宇)
|
14ms |
512 KiB |
|
379 Bytes |
2023-1-2 18:51:20 |
|
王晨志 (wangchenzhi)
|
14ms |
436 KiB |
|
551 Bytes |
2022-7-27 17:44:52 |
|
曹雅萱
|
14ms |
7.2 MiB |
C++11 |
327 Bytes |
2024-5-25 11:28:01 |
|
周琪渃
|
14ms |
512 KiB |
|
303 Bytes |
2022-12-7 21:45:51 |
|
时代一校林星宇 (lxy)
|
15ms |
436 KiB |
|
309 Bytes |
2022-9-10 17:43:53 |
|
蒲梓勋 (puzixun)
|
15ms |
428 KiB |
|
293 Bytes |
2022-9-11 11:47:38 |
|
原著校区 巫映秋 (巫映秋1a)
|
15ms |
7 MiB |
|
308 Bytes |
2023-12-3 16:49:13 |
|
缥 (王硕2012)
|
15ms |
392 KiB |
|
397 Bytes |
2023-3-23 19:06:04 |
|
新壹街校区-郭老师-陈品烨 (陈品烨)
|
15ms |
6.8 MiB |
|
264 Bytes |
2023-10-3 9:47:24 |
|
重庆龙湖源著校区+杨聆暄 (杨聆暄)
|
15ms |
440 KiB |
|
310 Bytes |
2023-2-1 18:05: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 |
384 KiB |
|
522 Bytes |
2023-1-7 11:32:14 |
|
chaikexu
|
15ms |
432 KiB |
|
263 Bytes |
2022-11-26 16:44:59 |
|
zcx
|
15ms |
392 KiB |
|
299 Bytes |
2023-1-7 11:32:40 |
|
zhouyonghao
|
15ms |
7 MiB |
C++20(O2) |
285 Bytes |
2024-6-1 14:35:07 |
|
wuqilin
|
15ms |
384 KiB |
|
318 Bytes |
2023-4-1 11:26:36 |
|
zhangzhimo
|
15ms |
428 KiB |
|
283 Bytes |
2022-12-3 16:55:28 |
|
colin1112 (墙凌可)
|
15ms |
6.7 MiB |
|
314 Bytes |
2023-9-4 21:13:33 |
|
11111
|
15ms |
432 KiB |
|
367 Bytes |
2022-4-10 9:45:14 |
|
22029-lyh
|
15ms |
404 KiB |
|
263 Bytes |
2023-1-7 11:11:50 |
|
22029-hqh
|
15ms |
392 KiB |
|
362 Bytes |
2023-1-7 11:50:02 |
|
小忙果 (王昱杰)
|
15ms |
6.9 MiB |
|
299 Bytes |
2023-7-18 8:54:44 |
|
谁陪訫牞 (杀手) (22029-zys)
|
15ms |
432 KiB |
|
263 Bytes |
2023-1-5 17:14:39 |
|
Nico
|
15ms |
6.9 MiB |
|
302 Bytes |
2023-7-18 13:10:07 |
|
李清城 (朱瀚文集训号)
|
15ms |
512 KiB |
|
283 Bytes |
2023-2-2 17:18:07 |
|
huyinuo
|
15ms |
436 KiB |
|
410 Bytes |
2022-8-22 11:41:22 |
|
新壹街校区-冉睦阳 (冉睦阳)
|
15ms |
7.1 MiB |
|
289 Bytes |
2023-12-8 20:17:09 |
|
爱琴海校区-刁钲洋 (刁钲洋)
|
15ms |
424 KiB |
|
282 Bytes |
2023-2-20 19:51:09 |
|
易锦程 (sky)
|
15ms |
7.1 MiB |
|
455 Bytes |
2023-12-3 18:59:09 |
|
廖海宇在追杀马牌痞 (liaohaiyu22031)
|
15ms |
384 KiB |
|
374 Bytes |
2023-1-7 11:44:12 |
|
胡澜之 (666hlz666)
|
15ms |
6.9 MiB |
|
269 Bytes |
2023-7-11 8:22:15 |
|
吃小孩的viv_
|
15ms |
7.3 MiB |
|
351 Bytes |
2023-7-18 17:42:41 |
|
ganlin1
|
15ms |
6.7 MiB |
|
285 Bytes |
2023-6-7 15:48:10 |
|
时代校区-刘臣原 (微笑王子)
|
15ms |
436 KiB |
|
266 Bytes |
2022-9-10 11:01:12 |
|
稻妻第一深情 (喝酒の吟游诗人)
|
15ms |
512 KiB |
|
1.4 KiB |
2023-3-12 0:36:19 |
|
Tender. (05c05-zhou)
|
15ms |
432 KiB |
|
283 Bytes |
2022-10-18 11:38:57 |
|
22029-lyh
|
16ms |
384 KiB |
|
263 Bytes |
2023-1-7 11:11:46 |
|
疯神芭芭脱丝 (李卓修)
|
16ms |
432 KiB |
|
263 Bytes |
2022-11-26 9:49:50 |
|
郭益豪(帅哥) (guoyihao)
|
16ms |
6.7 MiB |
|
310 Bytes |
2023-6-4 17:24:32 |
|
(金沙天街)严皓月 (严皓月)
|
16ms |
7.2 MiB |
|
357 Bytes |
2023-11-25 19:17:03 |
|
王晴萱
|
16ms |
6.9 MiB |
|
295 Bytes |
2023-7-14 16:11:00 |
|
22029-zjs
|
16ms |
384 KiB |
|
334 Bytes |
2023-1-7 11:34:22 |
|
ttt123
|
16ms |
384 KiB |
|
372 Bytes |
2023-1-7 11:34:03 |
|
缥 (王硕2012)
|
16ms |
512 KiB |
|
392 Bytes |
2023-3-23 19:05:15 |
|
xuniaoyin (徐袅音)
|
16ms |
6.9 MiB |
|
427 Bytes |
2023-8-6 18:28:30 |
|
22029-lyh
|
16ms |
384 KiB |
|
263 Bytes |
2023-1-7 11:11:49 |
|
22029-lyh
|
16ms |
392 KiB |
|
263 Bytes |
2023-1-7 11:11:49 |
|
22029-lsl
|
16ms |
428 KiB |
|
265 Bytes |
2023-1-7 11:03:42 |
|
朱老师 (zyp)
|
16ms |
512 KiB |
|
327 Bytes |
2022-8-7 11:16:04 |
|
Erin
|
16ms |
7.1 MiB |
C++98 |
280 Bytes |
2024-5-26 11:36:41 |
|
罗傲晴
|
16ms |
432 KiB |
|
345 Bytes |
2023-5-31 20:15:44 |
|
^_^ (ctc)
|
16ms |
6.8 MiB |
|
281 Bytes |
2023-6-19 20:19:37 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
17ms |
436 KiB |
|
248 Bytes |
2022-10-31 18:39:34 |
|
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)
|
17ms |
6.8 MiB |
|
368 Bytes |
2023-10-22 16:30:53 |
|
黄梓桐 (HuangZiTong)
|
17ms |
432 KiB |
|
268 Bytes |
2022-8-7 11:08:45 |
|
胡宸华 (huchenhua)
|
17ms |
444 KiB |
|
347 Bytes |
2023-1-7 16:25:08 |
|
王彬羽 (wby)
|
17ms |
7.2 MiB |
|
542 Bytes |
2023-11-30 20:15:14 |
|
Yuan (Zongzi1)
|
18ms |
6.7 MiB |
C++17(O2) |
380 Bytes |
2024-7-18 18:19:43 |
|
郑岐蔚
|
18ms |
428 KiB |
|
310 Bytes |
2023-1-26 14:36:23 |
|
章愉霖
|
18ms |
6.9 MiB |
|
290 Bytes |
2023-11-18 15:25:23 |
|
张雯皓 (zhangwenhao)
|
19ms |
7 MiB |
|
320 Bytes |
2023-12-23 11:20:41 |
|
邵清泉
|
19ms |
6.9 MiB |
|
492 Bytes |
2023-11-30 20:23:58 |
|
时代一校-赵彦博 (zyb)
|
20ms |
6.7 MiB |
|
449 Bytes |
2023-8-23 16:53:09 |
|
xuniaoyin (徐袅音)
|
21ms |
7 MiB |
|
449 Bytes |
2023-12-2 21:40:04 |
|
源著校区-宋昊成 (马冬梅)
|
22ms |
7.2 MiB |
|
293 Bytes |
2023-11-30 18:56:38 |
|
罗子琪
|
22ms |
7.1 MiB |
|
299 Bytes |
2023-12-8 20:21:03 |
|
贺睿林
|
23ms |
7.2 MiB |
|
335 Bytes |
2023-11-26 11:50:01 |
|
没有此人 (akm)
|
24ms |
6.9 MiB |
|
434 Bytes |
2023-12-9 15:30:45 |
|
新壹街校区-罗斤天 (罗斤天)
|
24ms |
6.9 MiB |
|
354 Bytes |
2023-12-8 20:17:17 |
|
新壹街校区-吴鑫鹏 (吴鑫鹏)
|
24ms |
7.1 MiB |
|
295 Bytes |
2023-12-8 20:16:09 |
|
新壹街校区--税崇峻 (税崇峻)
|
25ms |
7.2 MiB |
|
288 Bytes |
2023-12-8 20:15:42 |
|
田世瑞
|
25ms |
7.1 MiB |
|
384 Bytes |
2023-12-3 16:39:34 |
|
刘昊臻 (liuhaozhen)
|
26ms |
7.1 MiB |
|
332 Bytes |
2023-12-8 19:48:14 |
|
zyl
|
26ms |
7.3 MiB |
|
287 Bytes |
2024-1-5 13:34:03 |
|
Turorany (郑浩然)
|
26ms |
6.9 MiB |
|
437 Bytes |
2023-12-3 18:56:50 |
|
贾博涵
|
27ms |
6.8 MiB |
|
328 Bytes |
2023-11-23 14:54:43 |
|
新壹街校区-陈琬舒 (空空大师)
|
27ms |
6.9 MiB |
|
282 Bytes |
2023-11-26 20:11:46 |
|
赵浚言
|
28ms |
7.1 MiB |
|
335 Bytes |
2023-12-3 15:37:51 |
|
wanghaixi xxx
|
28ms |
7 MiB |
|
374 Bytes |
2023-12-7 19:55:03 |
|
源著校区-宋昊成 (马冬梅)
|
28ms |
7.1 MiB |
|
293 Bytes |
2023-12-7 19:27:13 |
|
wangjun
|
31ms |
7.2 MiB |
|
296 Bytes |
2023-11-30 12:15:49 |
|
郑驭辰
|
32ms |
7.1 MiB |
|
288 Bytes |
2023-12-20 19:41:05 |
|
源著校区-老师:刘扬-张博涵 (张博涵)
|
33ms |
6.9 MiB |
|
288 Bytes |
2023-12-8 20:17:51 |
|
中岛敦 (黄麒瑞)
|
43ms |
7.1 MiB |
|
331 Bytes |
2023-12-8 20:16:36 |
|
金沙校区-先珂熠 (九转大肠)
|
54ms |
548 KiB |
C++20(O2) |
297 Bytes |
2024-11-10 18:03:25 |
|
陈致远Lynn
|
55ms |
544 KiB |
C++11 |
407 Bytes |
2024-10-5 18:02:09 |
|
司雨来 (siyulai)
|
60ms |
532 KiB |
C++98 |
376 Bytes |
2024-11-12 21:44:58 |
|
胡云杰
|
60ms |
552 KiB |
C++11 |
302 Bytes |
2024-11-17 9:49:12 |
|
坏蛋宝宝 (王俊峰)
|
61ms |
768 KiB |
|
363 Bytes |
2024-4-4 19:01:44 |
|
小翔的粉丝
|
63ms |
764 KiB |
|
351 Bytes |
2024-4-6 11:32:22 |
|
三差学生 (尘埃蓝莓)
|
63ms |
536 KiB |
|
289 Bytes |
2024-4-6 11:36:32 |
|
杨嘉泽
|
63ms |
536 KiB |
|
294 Bytes |
2024-4-4 19:05:09 |
|
陈洲屹
|
64ms |
776 KiB |
C++98 |
352 Bytes |
2024-11-24 9:13:53 |
|
何锦宸熙
|
64ms |
532 KiB |
|
300 Bytes |
2024-4-4 19:17:15 |
|
没有此人 (akm)
|
65ms |
764 KiB |
|
324 Bytes |
2024-3-6 18:57:45 |
|
益布响完辣 (黄靖益1)
|
65ms |
548 KiB |
|
334 Bytes |
2024-3-6 18:56:33 |
|
max
|
65ms |
600 KiB |
C++11 |
312 Bytes |
2024-11-24 18:18:46 |