|
林敏浩 (Marklin)
|
7ms |
308 KiB |
|
592 Bytes |
2022-4-10 10:40:24 |
|
zhangyh (张育菡)
|
12ms |
432 KiB |
|
329 Bytes |
2022-6-20 21:55:43 |
|
SYC0226
|
12ms |
384 KiB |
|
283 Bytes |
2022-4-10 10:57:02 |
|
22029-zjs
|
13ms |
384 KiB |
|
338 Bytes |
2023-4-5 19:12:37 |
|
唐良瑞 (22016-tlr01)
|
13ms |
400 KiB |
|
323 Bytes |
2023-4-2 10:24:35 |
|
scallway
|
13ms |
512 KiB |
|
340 Bytes |
2023-4-28 17:40:10 |
|
scallway
|
13ms |
392 KiB |
|
358 Bytes |
2023-4-28 17:38:41 |
|
xmw318046
|
13ms |
6.7 MiB |
C++98 |
299 Bytes |
2024-7-12 10:21:18 |
|
杜俊宏
|
13ms |
384 KiB |
|
375 Bytes |
2022-6-23 21:20:01 |
|
喻文博 (22016-ywb)
|
13ms |
384 KiB |
|
277 Bytes |
2023-4-2 10:25:42 |
|
11111
|
13ms |
400 KiB |
|
251 Bytes |
2022-6-21 21:27:15 |
|
汪致卉 (wangzh)
|
13ms |
384 KiB |
|
375 Bytes |
2022-4-22 19:21:15 |
|
22016-yzq
|
13ms |
392 KiB |
|
303 Bytes |
2023-4-2 10:25:45 |
|
Error404sans (焦阳浩云)
|
13ms |
6.9 MiB |
C++20(O2) |
1.6 KiB |
2024-6-12 20:50:05 |
|
廖海宇在追杀马牌痞 (liaohaiyu22031)
|
13ms |
6.8 MiB |
C++98 |
317 Bytes |
2024-8-7 12:43:12 |
|
何昊宇 (22016-hhy)
|
13ms |
392 KiB |
|
303 Bytes |
2023-4-2 10:50:26 |
|
陈杰晟
|
13ms |
384 KiB |
|
320 Bytes |
2022-2-22 19:01:53 |
|
关博源
|
13ms |
392 KiB |
|
310 Bytes |
2023-3-12 14:49:03 |
|
wangzihang
|
13ms |
6.5 MiB |
C++98 |
739 Bytes |
2024-7-10 16:02:51 |
|
芒苒忧 (廖迦南)
|
13ms |
412 KiB |
|
295 Bytes |
2022-4-3 18:30:53 |
|
1396013295
|
13ms |
416 KiB |
|
375 Bytes |
2022-1-23 18:32:58 |
|
经常消失 (小萝卜)
|
14ms |
436 KiB |
|
314 Bytes |
2022-5-14 13:20:47 |
|
xuniaoyin (徐袅音)
|
14ms |
6.7 MiB |
|
320 Bytes |
2023-9-26 21:57:31 |
|
周琪渃
|
14ms |
384 KiB |
|
362 Bytes |
2023-1-5 21:38:18 |
|
xyc (谢雨宸)
|
14ms |
6.7 MiB |
|
368 Bytes |
2023-9-27 20:13:19 |
|
疯神芭芭脱丝 (李卓修)
|
14ms |
420 KiB |
|
581 Bytes |
2022-7-16 14:46:07 |
|
22016-lyj
|
14ms |
384 KiB |
|
293 Bytes |
2023-4-2 10:50:53 |
|
qinyi
|
14ms |
436 KiB |
|
314 Bytes |
2022-4-9 17:25:45 |
|
scallway
|
14ms |
436 KiB |
|
351 Bytes |
2023-4-28 17:32:54 |
|
爱琴海校区-刁钲洋 (刁钲洋)
|
14ms |
6.7 MiB |
|
298 Bytes |
2023-9-27 19:40:32 |
|
时代一校-赵彦博 (zyb)
|
14ms |
6.9 MiB |
|
581 Bytes |
2023-8-25 16:54:32 |
|
甄一阳 (22016-zyy)
|
14ms |
428 KiB |
|
295 Bytes |
2023-4-2 10:28:39 |
|
无尽的想象 (谭仕高)
|
14ms |
436 KiB |
|
291 Bytes |
2023-3-3 16:46:35 |
|
zcx
|
14ms |
384 KiB |
|
288 Bytes |
2023-4-1 11:30:54 |
|
李倾城的忠实假粉 (向熠可)
|
14ms |
492 KiB |
|
245 Bytes |
2022-3-27 14:53:20 |
|
朱老师 (zyp)
|
14ms |
432 KiB |
|
351 Bytes |
2022-8-20 14:27:18 |
|
杜是贤 (dushixian)
|
14ms |
384 KiB |
|
272 Bytes |
2022-10-16 9:53:13 |
|
luoluonuoya
|
14ms |
512 KiB |
|
295 Bytes |
2022-8-17 13:26:02 |
|
22029-lsl
|
14ms |
384 KiB |
|
293 Bytes |
2023-4-1 11:32:16 |
|
wangjun
|
14ms |
6.7 MiB |
|
300 Bytes |
2023-11-15 15:08:34 |
|
王浚西 (22016-wjx)
|
14ms |
384 KiB |
|
309 Bytes |
2023-4-2 10:30:03 |
|
hxb
|
14ms |
384 KiB |
|
269 Bytes |
2023-4-28 17:47:57 |
|
手搓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)
|
14ms |
384 KiB |
|
379 Bytes |
2023-4-1 11:27:32 |
|
缥 (王硕2012)
|
14ms |
412 KiB |
|
539 Bytes |
2023-3-27 19:30:41 |
|
余彦瑞
|
14ms |
440 KiB |
|
311 Bytes |
2023-4-16 11:56:57 |
|
章愉霖
|
14ms |
6.9 MiB |
|
271 Bytes |
2023-6-18 17:43:56 |
|
蒲梓勋 (puzixun)
|
15ms |
384 KiB |
|
329 Bytes |
2022-10-29 23:13:51 |
|
黄梓桐 (HuangZiTong)
|
15ms |
384 KiB |
|
297 Bytes |
2023-1-16 12:51:58 |
|
ttt123
|
15ms |
472 KiB |
|
297 Bytes |
2023-3-31 17:08:52 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
15ms |
512 KiB |
|
384 Bytes |
2022-11-18 12:41:59 |
|
11451254188 (22029-mjh)
|
15ms |
444 KiB |
|
307 Bytes |
2023-4-1 11:31:23 |
|
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)
|
15ms |
6.7 MiB |
|
417 Bytes |
2023-8-24 15:07:55 |
|
原著校区 巫映秋 (巫映秋1a)
|
15ms |
440 KiB |
|
264 Bytes |
2023-5-28 18:08:34 |
|
郑岐蔚
|
15ms |
392 KiB |
|
313 Bytes |
2023-1-9 14:43:33 |
|
欧俊阳
|
15ms |
6.7 MiB |
|
581 Bytes |
2023-8-25 13:31:06 |
|
王昱祺 (12王昱祺)
|
15ms |
6.8 MiB |
|
328 Bytes |
2023-6-11 17:47:07 |
|
王昱祺 (12王昱祺)
|
15ms |
6.8 MiB |
|
324 Bytes |
2023-6-11 17:58:40 |
|
姚宏逸
|
16ms |
384 KiB |
|
1.1 KiB |
2022-11-28 11:33:28 |
|
xiongxinyao
|
16ms |
428 KiB |
|
418 Bytes |
2022-11-13 11:31:10 |
|
我推的乱破 (贺俊楠)
|
16ms |
7.2 MiB |
|
383 Bytes |
2023-12-24 16:03:39 |
|
Tender. (05c05-zhou)
|
16ms |
8.2 MiB |
|
437 Bytes |
2023-8-24 10:39:17 |
|
陈风亦 (chenfengyi)
|
16ms |
436 KiB |
|
283 Bytes |
2023-1-18 17:04:32 |
|
RanHao
|
17ms |
6.9 MiB |
|
437 Bytes |
2023-8-2 12:16:10 |
|
三差学生(尘埃蓝莓) (白佳睿)
|
17ms |
6.9 MiB |
|
272 Bytes |
2023-8-8 16:28:34 |
|
林凡童 (lft)
|
18ms |
436 KiB |
|
382 Bytes |
2022-9-15 20:11:47 |
|
zyl
|
18ms |
7.3 MiB |
|
343 Bytes |
2024-1-21 15:01:33 |
|
ysf.wlanwq.ZJSWL 1922~1991 (韦舒豪)
|
64ms |
764 KiB |
|
233 Bytes |
2024-4-13 14:10:47 |
|
zvt_132 (任子轩)
|
65ms |
764 KiB |
C++98 |
250 Bytes |
2024-10-13 11:11:46 |
|
My name is Man (钟卓劭)
|
69ms |
540 KiB |
|
254 Bytes |
2024-3-20 15:51:04 |
|
安闵煜 (anzai)
|
72ms |
768 KiB |
C++11 |
421 Bytes |
2024-10-12 11:44:39 |
|
梨冻亿 (wiueh)
|
188ms |
3.9 MiB |
Python 3 |
176 Bytes |
2022-1-23 18:53:36 |
|
Marvin
|
193ms |
9.1 MiB |
Python 3 |
170 Bytes |
2023-6-23 10:35:45 |
|
kongql
|
197ms |
9 MiB |
Python 3 |
145 Bytes |
2023-7-23 19:58:23 |