|
凌肯 (lingken22006)
|
38ms |
392 KiB |
|
384 Bytes |
2022-10-23 16:59:18 |
|
凌肯 (lingken22006)
|
38ms |
392 KiB |
|
384 Bytes |
2022-10-23 16:59:20 |
|
陈风亦 (chenfengyi)
|
38ms |
520 KiB |
|
325 Bytes |
2022-11-15 22:24:54 |
|
任童(rentong)
|
38ms |
484 KiB |
|
393 Bytes |
2022-7-2 15:10:49 |
|
凌肯 (lingken22006)
|
38ms |
384 KiB |
|
384 Bytes |
2022-10-23 17:02:38 |
|
凌肯 (lingken22006)
|
38ms |
412 KiB |
|
384 Bytes |
2022-10-23 17:02:02 |
|
凌肯 (lingken22006)
|
38ms |
512 KiB |
|
384 Bytes |
2022-10-23 16:59:19 |
|
凌肯 (lingken22006)
|
38ms |
512 KiB |
|
384 Bytes |
2022-10-23 17:02:38 |
|
凌肯 (lingken22006)
|
38ms |
384 KiB |
|
384 Bytes |
2022-10-23 17:02:40 |
|
小翔的粉丝
|
38ms |
6.7 MiB |
|
339 Bytes |
2023-9-4 20:29:43 |
|
22029-lsl
|
38ms |
412 KiB |
|
300 Bytes |
2023-4-15 10:08:18 |
|
时代一校-赵彦博 (zyb)
|
38ms |
6.9 MiB |
|
369 Bytes |
2023-8-10 13:09:35 |
|
凌肯 (lingken22006)
|
38ms |
456 KiB |
|
384 Bytes |
2022-10-23 17:02:04 |
|
手搓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)
|
38ms |
512 KiB |
|
359 Bytes |
2023-5-19 18:56:00 |
|
凌肯 (lingken22006)
|
38ms |
384 KiB |
|
384 Bytes |
2022-10-23 16:59:21 |
|
朱老师 (zyp)
|
38ms |
6.8 MiB |
|
363 Bytes |
2023-10-3 11:47:14 |
|
凌肯 (lingken22006)
|
38ms |
444 KiB |
|
384 Bytes |
2022-10-23 17:02:39 |
|
希蒙 (zhengxingya)
|
39ms |
6.9 MiB |
|
415 Bytes |
2023-8-24 16:08:15 |
|
凌肯 (lingken22006)
|
39ms |
448 KiB |
|
384 Bytes |
2022-10-23 17:02:10 |
|
凌肯 (lingken22006)
|
39ms |
392 KiB |
|
384 Bytes |
2022-10-23 16:59:19 |
|
在煎鱼的肖大总铳 (肖宇航)
|
39ms |
6.8 MiB |
|
338 Bytes |
2023-9-24 11:26:39 |
|
cupy战士 (05c05-dkf)
|
39ms |
6.8 MiB |
|
310 Bytes |
2023-10-22 10:15:12 |
|
luosifu22006
|
39ms |
384 KiB |
|
366 Bytes |
2022-10-23 17:06:46 |
|
廖海宇在追杀马牌痞 (liaohaiyu22031)
|
39ms |
392 KiB |
|
385 Bytes |
2023-4-30 10:36:46 |
|
Tender. (05c05-zhou)
|
39ms |
444 KiB |
|
289 Bytes |
2022-10-19 22:01:57 |
|
凌肯 (lingken22006)
|
39ms |
548 KiB |
|
384 Bytes |
2022-10-23 16:59:14 |
|
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)
|
39ms |
6.7 MiB |
|
313 Bytes |
2023-8-24 14:51:17 |
|
李晨希
|
39ms |
7.2 MiB |
|
388 Bytes |
2023-7-19 11:51:16 |
|
朱老师 (zyp)
|
39ms |
456 KiB |
|
339 Bytes |
2022-10-23 17:01:15 |
|
李晨希
|
39ms |
7.2 MiB |
|
388 Bytes |
2023-7-19 11:51:40 |
|
RanHao
|
39ms |
6.9 MiB |
|
490 Bytes |
2023-8-2 13:10:21 |
|
李禹衡 (liyuheng22006)
|
40ms |
384 KiB |
|
285 Bytes |
2022-10-23 17:07:02 |
|
yyds (杨骐嘉)
|
40ms |
6.9 MiB |
|
360 Bytes |
2023-7-16 10:59:16 |
|
草||草 (陈星佑)
|
40ms |
512 KiB |
|
337 Bytes |
2023-1-9 16:21:24 |
|
徐康景 (dcm)
|
40ms |
384 KiB |
|
388 Bytes |
2022-11-26 9:43:42 |
|
草||草 (陈星佑)
|
40ms |
392 KiB |
|
337 Bytes |
2023-1-9 16:21:21 |
|
zzy
|
40ms |
444 KiB |
|
413 Bytes |
2023-4-8 16:18:25 |
|
wky
|
40ms |
468 KiB |
|
340 Bytes |
2022-11-26 10:00:56 |
|
scallway
|
40ms |
384 KiB |
|
558 Bytes |
2023-3-11 14:11:52 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
40ms |
392 KiB |
|
370 Bytes |
2022-10-23 17:03:30 |
|
朱老师 (zyp)
|
40ms |
504 KiB |
|
714 Bytes |
2022-9-4 17:14:49 |
|
miku (阳沐珊)
|
40ms |
6.9 MiB |
|
342 Bytes |
2023-7-21 8:27:15 |
|
22029-lyh
|
40ms |
392 KiB |
|
376 Bytes |
2023-5-3 17:07:49 |
|
凌肯 (lingken22006)
|
40ms |
444 KiB |
|
384 Bytes |
2022-10-23 17:02:39 |
|
jdy
|
41ms |
480 KiB |
|
300 Bytes |
2022-11-26 9:57:17 |
|
zhuqiwei22006
|
41ms |
408 KiB |
|
296 Bytes |
2022-10-23 17:07:21 |
|
zhangheyi22006
|
41ms |
392 KiB |
|
313 Bytes |
2022-10-23 17:10:27 |
|
ttt123
|
41ms |
460 KiB |
|
324 Bytes |
2022-7-1 14:40:18 |
|
新壹街校区-杨轩懿 (杨轩懿1)
|
41ms |
6.9 MiB |
|
353 Bytes |
2023-7-25 12:11:21 |
|
周琪渃
|
41ms |
584 KiB |
|
440 Bytes |
2023-4-15 18:55:53 |
|
时代二校-焦雨齐 (Angel)
|
41ms |
8.1 MiB |
|
371 Bytes |
2023-7-18 14:50:18 |
|
李树崑 (lishukun)
|
41ms |
832 KiB |
|
373 Bytes |
2022-6-26 12:27:50 |
|
小忙果 (王昱杰)
|
41ms |
6.8 MiB |
|
362 Bytes |
2023-9-2 17:05:34 |
|
12345
|
42ms |
832 KiB |
|
349 Bytes |
2022-8-3 17:04:48 |
|
罗翌珂 (dangdang)
|
42ms |
460 KiB |
|
419 Bytes |
2022-9-3 10:53:22 |
|
凌肯 (lingken22006)
|
42ms |
456 KiB |
|
384 Bytes |
2022-10-23 17:02:39 |
|
叶雨昊 (yeyuhao22006)
|
42ms |
384 KiB |
|
329 Bytes |
2022-10-23 17:07:59 |
|
缥 (王硕2012)
|
42ms |
384 KiB |
|
439 Bytes |
2023-4-15 11:25:24 |
|
scallway
|
42ms |
504 KiB |
|
714 Bytes |
2023-3-11 14:11:25 |
|
王义苇 (wangyiwei)
|
43ms |
6.7 MiB |
|
348 Bytes |
2023-6-11 14:37:25 |
|
zhm123
|
43ms |
460 KiB |
|
337 Bytes |
2023-3-17 19:16:26 |
|
纪承熙 (jcx001)
|
43ms |
7.1 MiB |
|
349 Bytes |
2023-7-11 10:38:22 |
|
新壹街陈科言 (cky)
|
43ms |
7 MiB |
|
365 Bytes |
2023-7-19 16:26:48 |
|
郑岐蔚
|
45ms |
824 KiB |
|
337 Bytes |
2023-1-26 14:53:12 |
|
wangjun
|
46ms |
7 MiB |
|
425 Bytes |
2023-12-22 10:13:20 |
|
乐瀚阳 (yuehanyang)
|
46ms |
6.8 MiB |
|
342 Bytes |
2023-6-15 19:21:35 |
|
新壹街 朱启航 (zhuqihang)
|
54ms |
7 MiB |
|
418 Bytes |
2024-1-24 8:06:48 |
|
Tang
|
63ms |
2.3 MiB |
|
848 Bytes |
2022-6-4 11:24:52 |
|
章愉霖
|
84ms |
7.3 MiB |
|
351 Bytes |
2023-6-16 10:23:30 |
|
kql1
|
86ms |
8.1 MiB |
C++98 |
310 Bytes |
2024-5-9 13:21:03 |
|
AAA? Prow max (hechenxuan23005)
|
92ms |
8.1 MiB |
C++98 |
332 Bytes |
2024-6-15 16:22:30 |
|
邹曜丞 (13983097018)
|
100ms |
8.3 MiB |
|
435 Bytes |
2023-7-18 14:51:01 |
|
杨浩灵 (金坷拉)
|
100ms |
8 MiB |
|
736 Bytes |
2023-7-18 16:34:59 |
|
叶哲宇 (yzy)
|
144ms |
572 KiB |
|
332 Bytes |
2024-3-2 10:22:28 |
|
My name is Man (钟卓劭)
|
146ms |
772 KiB |
|
277 Bytes |
2024-3-31 9:11:38 |
|
蔡蕊池
|
151ms |
536 KiB |
|
382 Bytes |
2024-3-2 13:40:14 |
|
¿¿¿??? (李睿瞳)
|
153ms |
764 KiB |
|
404 Bytes |
2024-2-1 14:33:59 |
|
刘煜轩
|
154ms |
552 KiB |
|
372 Bytes |
2024-3-28 22:51:18 |
|
zyl
|
157ms |
532 KiB |
|
360 Bytes |
2024-2-2 10:07:43 |
|
新壹街校区-张振灏 (张振灏)
|
157ms |
768 KiB |
|
321 Bytes |
2024-4-3 18:58:40 |
|
yanyuhan
|
157ms |
532 KiB |
|
353 Bytes |
2024-3-2 10:22:33 |
|
煞笔笔
|
159ms |
764 KiB |
|
283 Bytes |
2024-4-4 11:07:01 |
|
(^-^) (蒋金卓)
|
159ms |
764 KiB |
|
336 Bytes |
2024-1-29 16:42:39 |
|
BJ6180C8CTD (Fan)
|
160ms |
536 KiB |
|
407 Bytes |
2024-3-2 10:24:15 |
|
这是非常▦▦▦的 (段秉辰)
|
161ms |
764 KiB |
C++17 |
376 Bytes |
2024-11-3 11:57:18 |
|
cainuoyan
|
166ms |
580 KiB |
C++98 |
348 Bytes |
2024-10-17 20:37:11 |
|
张睎宇
|
168ms |
572 KiB |
C++17 |
373 Bytes |
2024-11-16 13:23:10 |
|
chaikexu
|
170ms |
4.3 MiB |
|
395 Bytes |
2023-2-26 11:18:29 |
|
ReFly (NKZKY)
|
171ms |
804 KiB |
|
428 Bytes |
2024-2-1 17:04:52 |
|
JOKER (hhy)
|
174ms |
920 KiB |
|
319 Bytes |
2024-3-2 10:27:52 |
|
赵奕铭
|
174ms |
768 KiB |
|
273 Bytes |
2024-3-7 22:01:12 |
|
kongql
|
417ms |
9.1 MiB |
Python 3 |
162 Bytes |
2023-7-29 9:56:36 |
|
梨冻亿 (wiueh)
|
448ms |
4 MiB |
Python 3 |
300 Bytes |
2022-1-23 19:38:46 |
|
汪致卉 (wangzh)
|
450ms |
4 MiB |
Python 3 |
212 Bytes |
2022-4-22 16:43:46 |
|
阮 (媚狐不吃道旁李)
|
530ms |
41.9 MiB |
C++98 |
360 Bytes |
2024-5-2 16:50:45 |
|
张月恒
|
2499ms |
38.7 MiB |
C++11(O2) |
296 Bytes |
2024-9-26 20:12:24 |