|
廖海宇在追杀马牌痞 (liaohaiyu22031)
|
3ms |
7.1 MiB |
|
357 Bytes |
2023-12-3 14:24:27 |
|
yizixun
|
4ms |
312 KiB |
|
692 Bytes |
2022-8-25 22:34:40 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
7ms |
384 KiB |
|
330 Bytes |
2023-4-2 18:40:32 |
|
朱泽晟
|
7ms |
384 KiB |
|
386 Bytes |
2023-2-2 14:15:25 |
|
偽艺術家 (chenyanchi22006)
|
7ms |
384 KiB |
|
361 Bytes |
2023-4-2 18:40:36 |
|
陈雨泽1
|
7ms |
384 KiB |
|
331 Bytes |
2023-4-21 21:03:17 |
|
临时账户(dangdang)
|
7ms |
384 KiB |
|
452 Bytes |
2023-2-2 14:41:57 |
|
罗伟杰 (13308275065)
|
7ms |
384 KiB |
|
442 Bytes |
2023-2-2 14:25:02 |
|
ycy
|
7ms |
384 KiB |
|
473 Bytes |
2023-2-2 14:11:45 |
|
Tender. (05c05-zhou)
|
7ms |
428 KiB |
|
517 Bytes |
2023-5-14 17:10:36 |
|
叶雨昊 (yeyuhao22006)
|
7ms |
392 KiB |
|
289 Bytes |
2023-4-2 18:44:11 |
|
罗伟杰 (13308275065)
|
7ms |
444 KiB |
|
441 Bytes |
2023-2-2 14:24:24 |
|
临时账户(dangdang)
|
7ms |
384 KiB |
|
414 Bytes |
2023-2-2 14:17:06 |
|
可爱的小花狗
|
7ms |
7.4 MiB |
C++11 |
582 Bytes |
2024-4-27 15:06:37 |
|
罗伟杰 (13308275065)
|
7ms |
384 KiB |
|
476 Bytes |
2023-2-2 14:42:41 |
|
scallway
|
7ms |
6.7 MiB |
|
300 Bytes |
2023-9-1 10:29:20 |
|
郭人瑀1
|
7ms |
384 KiB |
|
432 Bytes |
2023-2-2 14:16:26 |
|
scallway
|
8ms |
6.7 MiB |
|
305 Bytes |
2023-9-1 10:29:56 |
|
scallway
|
8ms |
6.7 MiB |
|
314 Bytes |
2023-9-1 11:08:07 |
|
何洋名 (heyangming)
|
8ms |
444 KiB |
|
517 Bytes |
2022-11-27 10:17:22 |
|
时代二校-焦雨齐 (Angel)
|
8ms |
7.1 MiB |
|
262 Bytes |
2024-1-19 18:22:14 |
|
zhm123
|
8ms |
436 KiB |
|
338 Bytes |
2022-12-8 21:00:51 |
|
scallway
|
8ms |
6.7 MiB |
|
314 Bytes |
2023-9-1 10:21:26 |
|
scallway
|
8ms |
6.7 MiB |
|
314 Bytes |
2023-9-1 11:21:56 |
|
张子轩 (zhangzixuana)
|
8ms |
384 KiB |
|
583 Bytes |
2023-5-13 15:04:39 |
|
黄梓桐 (HuangZiTong)
|
8ms |
520 KiB |
|
282 Bytes |
2022-12-18 12:32:03 |
|
姚宏逸
|
8ms |
448 KiB |
|
364 Bytes |
2022-11-8 9:04:53 |
|
zhm123
|
9ms |
384 KiB |
|
273 Bytes |
2022-12-8 22:18:40 |
|
kcs007
|
9ms |
444 KiB |
|
292 Bytes |
2023-5-13 15:12:53 |
|
王祎辰 (wangyichen)
|
9ms |
6.7 MiB |
|
307 Bytes |
2023-6-8 18:53:30 |
|
赵沛喆
|
9ms |
412 KiB |
|
421 Bytes |
2022-12-22 22:31:04 |
|
刘鹤枫 (liuhefeng)
|
9ms |
384 KiB |
|
308 Bytes |
2022-8-7 14:12:09 |
|
colin1112
|
9ms |
6.7 MiB |
|
329 Bytes |
2023-9-1 14:16:33 |
|
新壹街校区-陈琬舒 (空空大师)
|
9ms |
7 MiB |
|
269 Bytes |
2023-10-28 10:31:32 |
|
huyinuo
|
10ms |
448 KiB |
|
306 Bytes |
2023-1-5 16:10:07 |
|
蒲梓勋 (puzixun)
|
10ms |
440 KiB |
|
246 Bytes |
2023-2-2 13:57:17 |
|
杜俊宏
|
10ms |
512 KiB |
|
361 Bytes |
2022-8-22 8:32:35 |
|
Tender. (05c05-zhou)
|
11ms |
384 KiB |
|
517 Bytes |
2023-4-2 18:41:24 |
|
时代2校-程俊燃 (chengjunran)
|
13ms |
7.2 MiB |
|
253 Bytes |
2024-1-20 18:24:29 |
|
罗伟杰 (13308275065)
|
18ms |
432 KiB |
|
323 Bytes |
2022-12-5 21:15:26 |
|
zzzrrrxxx
|
26ms |
7.3 MiB |
|
202 Bytes |
2024-1-21 15:38:05 |
|
手搓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)
|
28ms |
6.8 MiB |
|
261 Bytes |
2023-6-11 9:58:20 |
|
zhm123
|
32ms |
476 KiB |
|
333 Bytes |
2022-12-8 22:17:00 |
|
时代二校+王吕棪 (wanglvyan)
|
36ms |
544 KiB |
|
260 Bytes |
2024-2-24 15:29:04 |
|
张梓浩 (zhangzihao)
|
36ms |
532 KiB |
|
292 Bytes |
2024-3-24 11:07:42 |
|
孙烽轶 (sfy)
|
36ms |
548 KiB |
|
298 Bytes |
2024-3-4 20:23:04 |
|
张智洋
|
37ms |
548 KiB |
|
281 Bytes |
2024-3-16 16: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)
|
37ms |
536 KiB |
|
427 Bytes |
2024-1-25 18:32:43 |
|
小码王高新校区—刘晨皓 (shishen)
|
37ms |
532 KiB |
C++98 |
280 Bytes |
2024-11-27 19:40:38 |
|
Yuan (Zongzi1)
|
38ms |
768 KiB |
C++17(O2) |
359 Bytes |
2024-11-27 19:25:27 |
|
huanglu
|
38ms |
764 KiB |
C++98 |
1.1 KiB |
2024-9-1 11:47:53 |
|
时代一校 - 冯隆浩 (冯隆浩)
|
41ms |
384 KiB |
|
286 Bytes |
2023-5-6 18:43:27 |
|
colin1112 (墙凌可)
|
42ms |
432 KiB |
|
340 Bytes |
2023-3-19 16:29:03 |
|
(张洛诚)
|
43ms |
7 MiB |
|
388 Bytes |
2023-6-10 20:39:22 |
|
吴恩子
|
293ms |
6.8 MiB |
|
228 Bytes |
2023-10-7 19:37:59 |
|
赵志陶 (zztzzt)
|
296ms |
436 KiB |
|
306 Bytes |
2022-11-10 12:20:55 |
|
Guest
|
306ms |
6.8 MiB |
|
232 Bytes |
2023-10-22 13:13:06 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
350ms |
424 KiB |
|
293 Bytes |
2022-11-28 16:39:27 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
354ms |
568 KiB |
|
445 Bytes |
2022-11-14 11:00:44 |
|
444444444 (唐跃元)
|
355ms |
408 KiB |
|
235 Bytes |
2023-5-13 15:10:15 |
|
李树崑 (lishukun)
|
567ms |
512 KiB |
|
325 Bytes |
2022-6-23 20:14:26 |
|
新壹街校区-冉睦阳 (冉睦阳)
|
574ms |
548 KiB |
|
253 Bytes |
2024-3-10 11:27:09 |
|
12345
|
723ms |
432 KiB |
|
301 Bytes |
2022-6-23 14:57:19 |