|
wangzihang
|
7ms |
6.6 MiB |
C++98 |
1.1 KiB |
2024-7-13 16:09:15 |
|
My name is Man (钟卓劭)
|
7ms |
6.8 MiB |
C++98 |
529 Bytes |
2024-8-7 9:21:01 |
|
wangjun
|
7ms |
7 MiB |
|
466 Bytes |
2023-12-21 17:27:54 |
|
姚宏逸
|
8ms |
384 KiB |
|
533 Bytes |
2022-5-29 11:50:17 |
|
Yuan (Zongzi1)
|
8ms |
6.6 MiB |
C++17(O2) |
522 Bytes |
2024-7-24 10:43:17 |
|
hyh
|
8ms |
7.2 MiB |
C++98 |
381 Bytes |
2024-5-4 9:12:01 |
|
luoluonuoya
|
8ms |
384 KiB |
|
571 Bytes |
2022-8-10 14:38:52 |
|
17779
|
8ms |
384 KiB |
|
421 Bytes |
2022-3-31 21:34:46 |
|
枉哲锐
|
8ms |
384 KiB |
|
379 Bytes |
2022-1-26 20:16:00 |
|
时代2校-程俊燃 (chengjunran)
|
8ms |
6.7 MiB |
|
443 Bytes |
2023-9-23 21:18:28 |
|
王乐仪
|
8ms |
384 KiB |
|
410 Bytes |
2022-5-29 15:38:13 |
|
杜俊宏
|
8ms |
384 KiB |
|
419 Bytes |
2022-6-18 14:45:42 |
|
(张洛诚)
|
8ms |
384 KiB |
|
531 Bytes |
2023-2-21 20:14:27 |
|
关博源
|
8ms |
384 KiB |
|
476 Bytes |
2023-5-20 10:16:25 |
|
龚信丞
|
8ms |
384 KiB |
|
452 Bytes |
2023-5-28 19:10:02 |
|
zzzrrrxxx
|
8ms |
6.8 MiB |
|
379 Bytes |
2023-10-19 21:56:18 |
|
kkksc03 (彭士锋)
|
8ms |
404 KiB |
|
480 Bytes |
2022-3-12 13:44:46 |
|
李倾城的忠实假粉 (向熠可)
|
8ms |
444 KiB |
|
353 Bytes |
2022-3-27 15:32:52 |
|
郭人瑀作业号
|
8ms |
512 KiB |
|
486 Bytes |
2022-8-2 16:45:18 |
|
lch (凌昌瀚)
|
8ms |
440 KiB |
|
447 Bytes |
2022-7-7 22:18:57 |
|
汪致卉 (wangzh)
|
8ms |
476 KiB |
|
485 Bytes |
2022-4-22 19:27:50 |
|
_PXY_
|
8ms |
460 KiB |
|
454 Bytes |
2022-1-22 16:01:34 |
|
金沙校区-冉一梵 (冉一梵)
|
8ms |
6.9 MiB |
C++98 |
429 Bytes |
2024-5-24 16:23:09 |
|
赵泳鑫 (zhaoyongxin)
|
8ms |
432 KiB |
|
480 Bytes |
2022-7-17 10:18:18 |
|
奇怪的正义人! (leweiqi)
|
8ms |
512 KiB |
|
473 Bytes |
2022-7-17 17:00:21 |
|
文硕 (文硕1)
|
8ms |
448 KiB |
|
447 Bytes |
2022-7-12 11:45:12 |
|
huyinuo
|
8ms |
432 KiB |
|
468 Bytes |
2022-8-20 14:34:19 |
|
cupy战士 (05c05-dkf)
|
8ms |
432 KiB |
|
444 Bytes |
2022-10-30 15:41:37 |
|
朱老师 (zyp)
|
8ms |
440 KiB |
|
564 Bytes |
2022-9-4 17:22:11 |
|
周琪渃
|
8ms |
384 KiB |
|
541 Bytes |
2023-4-15 18:51:17 |
|
TJL
|
8ms |
6.7 MiB |
|
464 Bytes |
2023-9-3 11:04:57 |
|
ysf.wlanwq.ZJSWL 1922~1991 (韦舒豪)
|
8ms |
7.4 MiB |
C++98 |
419 Bytes |
2024-5-18 14:28:56 |
|
李山水
|
8ms |
428 KiB |
|
440 Bytes |
2022-3-6 19:12:34 |
|
黄梓桐 (HuangZiTong)
|
8ms |
384 KiB |
|
456 Bytes |
2023-3-19 16:04:41 |
|
向南地
|
8ms |
440 KiB |
|
466 Bytes |
2022-2-22 19:06:15 |
|
中岛敦 (黄麒瑞)
|
9ms |
7.3 MiB |
|
543 Bytes |
2023-9-29 10:12:36 |
|
林凡童 (lft)
|
9ms |
432 KiB |
|
482 Bytes |
2022-9-15 20:16:16 |
|
李山水
|
9ms |
428 KiB |
|
440 Bytes |
2022-3-6 19:12:24 |
|
朱老师 (zyp)
|
9ms |
6.8 MiB |
|
482 Bytes |
2023-7-10 7:06:17 |
|
xmw318046
|
9ms |
6.7 MiB |
C++98 |
665 Bytes |
2024-7-31 15:14:01 |
|
任童(rentong)
|
9ms |
512 KiB |
|
522 Bytes |
2023-2-4 16:20:55 |
|
chen (peter)
|
9ms |
512 KiB |
|
480 Bytes |
2022-7-19 14:40:02 |
|
qinyi
|
9ms |
440 KiB |
|
434 Bytes |
2022-10-22 9:13:46 |
|
时代二校-焦雨齐 (Angel)
|
9ms |
7.2 MiB |
|
424 Bytes |
2023-7-19 11:05:03 |
|
我推的乱破 (贺俊楠)
|
9ms |
6.7 MiB |
|
568 Bytes |
2023-9-17 9:14:02 |
|
黄歆恬 (teresac)
|
9ms |
436 KiB |
|
546 Bytes |
2022-10-16 15:48:39 |
|
疯神芭芭脱丝 (李卓修)
|
9ms |
440 KiB |
|
454 Bytes |
2022-7-9 17:08:19 |
|
霍弈丞小号
|
9ms |
444 KiB |
|
429 Bytes |
2023-4-16 17:12:16 |
|
新壹街校区-杨轩懿 (杨轩懿1)
|
9ms |
6.9 MiB |
|
394 Bytes |
2023-7-25 12:18:33 |
|
张景豪
|
9ms |
384 KiB |
|
422 Bytes |
2023-5-31 19:45:44 |
|
Tender. (05c05-zhou)
|
9ms |
440 KiB |
|
409 Bytes |
2022-10-19 22:02:26 |
|
胡宸华 (huchenhua)
|
9ms |
7 MiB |
|
447 Bytes |
2023-8-20 20:17:04 |
|
赵泳鑫 (zhaoyongxin)
|
9ms |
432 KiB |
|
447 Bytes |
2022-4-21 20:32:01 |
|
56 (13883454928)
|
9ms |
444 KiB |
|
407 Bytes |
2023-3-23 19:10:58 |
|
RanHao
|
9ms |
6.9 MiB |
|
506 Bytes |
2023-8-2 12:03:32 |
|
ycy
|
9ms |
384 KiB |
|
623 Bytes |
2022-8-7 16:36:28 |
|
龙湖时代C馆-邹镇宇 (邹镇宇)
|
9ms |
7.1 MiB |
|
598 Bytes |
2023-6-29 19:18:47 |
|
疯神芭芭脱丝 (李卓修)
|
9ms |
516 KiB |
|
570 Bytes |
2023-4-8 16:57:47 |
|
miku (阳沐珊)
|
9ms |
6.9 MiB |
|
496 Bytes |
2023-7-20 13:36:02 |
|
xiongxinyao
|
9ms |
448 KiB |
|
601 Bytes |
2022-12-4 11:03:45 |
|
杜是贤 (dushixian)
|
9ms |
384 KiB |
|
402 Bytes |
2022-12-4 10:06:28 |
|
赵沛喆
|
9ms |
396 KiB |
|
422 Bytes |
2022-10-16 11:06:55 |
|
经常消失 (小萝卜)
|
9ms |
392 KiB |
|
521 Bytes |
2023-3-19 14:15:14 |
|
源著校区-老师:刘扬-张博涵 (张博涵)
|
9ms |
6.9 MiB |
|
461 Bytes |
2023-8-9 23:03:30 |
|
希蒙 (zhengxingya)
|
9ms |
7.4 MiB |
|
424 Bytes |
2023-7-19 11:05:37 |
|
邹曜丞 (13983097018)
|
9ms |
6.9 MiB |
|
503 Bytes |
2023-7-19 13:58:21 |
|
zlx (xiao)
|
9ms |
512 KiB |
|
445 Bytes |
2022-11-26 19:21: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)
|
9ms |
6.9 MiB |
|
493 Bytes |
2023-8-10 11:13:16 |
|
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)
|
9ms |
6.7 MiB |
|
540 Bytes |
2023-9-20 19:26:13 |
|
火星伞宾——刘晏恺 (刘晏恺)
|
9ms |
6.7 MiB |
|
396 Bytes |
2023-8-24 11:36:44 |
|
陈雨泽1
|
9ms |
384 KiB |
|
447 Bytes |
2023-6-3 10:15:44 |
|
秦子越 (13883322087)
|
9ms |
392 KiB |
|
460 Bytes |
2022-10-16 16:12:54 |
|
MoonLight ( aaa)
|
9ms |
436 KiB |
|
485 Bytes |
2022-2-11 18:56:19 |
|
时代一校-赵彦博 (zyb)
|
10ms |
6.9 MiB |
|
382 Bytes |
2023-7-15 11:13:47 |
|
张峻瑞
|
10ms |
384 KiB |
|
403 Bytes |
2022-10-16 11:43:29 |
|
新壹街校区-陈琬舒 (空空大师)
|
10ms |
6.7 MiB |
|
418 Bytes |
2023-9-10 15:52:18 |
|
杨瀚霖 (yanghanlin)
|
10ms |
7.4 MiB |
|
599 Bytes |
2023-6-24 11:14:59 |
|
11111
|
10ms |
436 KiB |
|
517 Bytes |
2022-10-16 10:14:52 |
|
陈风亦 (chenfengyi)
|
10ms |
432 KiB |
|
465 Bytes |
2023-1-18 17:06:09 |
|
zhm123
|
10ms |
432 KiB |
|
480 Bytes |
2023-3-17 18:43:12 |
|
guozuming
|
10ms |
440 KiB |
|
388 Bytes |
2023-1-7 14:48:09 |
|
CPL
|
10ms |
440 KiB |
|
402 Bytes |
2023-3-19 9:40:14 |
|
Randy Marsh (杨子腾)
|
10ms |
384 KiB |
|
433 Bytes |
2022-12-10 14:06:03 |
|
(张洛诚)
|
11ms |
512 KiB |
|
533 Bytes |
2023-2-21 20:12:07 |
|
xuniaoyin (徐袅音)
|
11ms |
7.2 MiB |
|
392 Bytes |
2024-1-22 14:41:15 |
|
huanglu
|
11ms |
6.9 MiB |
|
461 Bytes |
2023-8-9 23:00:28 |
|
杨坤霖 (steven)
|
11ms |
256 KiB |
|
603 Bytes |
2023-3-19 14:37:02 |
|
huanglu
|
12ms |
384 KiB |
|
581 Bytes |
2022-6-14 14:51:06 |
|
小忙果 (王昱杰)
|
12ms |
7.1 MiB |
|
475 Bytes |
2023-12-3 14:16:55 |
|
牟淳雅
|
12ms |
7.3 MiB |
|
496 Bytes |
2023-12-31 10:55:09 |
|
欧俊阳
|
13ms |
6.8 MiB |
|
440 Bytes |
2023-8-24 15:28:17 |
|
郑岐蔚
|
14ms |
428 KiB |
|
518 Bytes |
2023-1-26 14:53:35 |
|
新壹街—熊轩杭 (xiongxuanhang)
|
17ms |
7.2 MiB |
|
490 Bytes |
2023-11-30 20:19:15 |
|
renqiumo
|
17ms |
384 KiB |
|
1023 Bytes |
2022-11-13 13:51:11 |
|
renqiumo
|
25ms |
384 KiB |
|
1023 Bytes |
2022-11-13 13:51:12 |
|
BJ6180C8CTD (Fan)
|
32ms |
536 KiB |
|
505 Bytes |
2024-3-2 10:38:26 |
|
叶哲宇 (yzy)
|
34ms |
548 KiB |
|
445 Bytes |
2024-3-2 10:41:04 |
|
爱琴海校区-刁钲洋 (刁钲洋)
|
35ms |
536 KiB |
|
472 Bytes |
2024-3-6 22:19:21 |
|
蔡蕊池
|
35ms |
764 KiB |
|
493 Bytes |
2024-3-23 21:04:33 |
|
cj66
|
36ms |
768 KiB |
C++11(O2) |
366 Bytes |
2024-9-19 21:33:45 |