|
张梓轩 (zhangzixuan)
|
14ms |
292 KiB |
|
224 Bytes |
2022-2-19 9:50:55 |
|
wangruibo20xh
|
14ms |
384 KiB |
|
205 Bytes |
2022-2-11 14:06:34 |
|
李彭 宋代诗人 (ljy123456)
|
17ms |
312 KiB |
|
329 Bytes |
2023-3-23 7:04:48 |
|
wangjun
|
23ms |
6.9 MiB |
|
199 Bytes |
2023-11-29 12:04:48 |
|
时代校区-孔令皓 (konglinghao)
|
24ms |
6.6 MiB |
C++98 |
1.2 KiB |
2024-7-13 17:20:15 |
|
杜俊宏
|
25ms |
384 KiB |
|
177 Bytes |
2022-7-11 21:07:32 |
|
NJL (NJlL)
|
26ms |
392 KiB |
|
275 Bytes |
2022-3-27 18:09:22 |
|
王韵淮
|
26ms |
512 KiB |
|
171 Bytes |
2022-5-20 21:49:41 |
|
吴俊成 (wujuncheng)
|
26ms |
428 KiB |
|
230 Bytes |
2022-7-11 20:00:28 |
|
汪致卉 (wangzh)
|
27ms |
404 KiB |
|
275 Bytes |
2022-1-29 0:35:45 |
|
傅博涛
|
27ms |
512 KiB |
|
189 Bytes |
2022-7-11 17:52:22 |
|
05c30-dyh
|
27ms |
392 KiB |
|
302 Bytes |
2022-2-26 15:32:45 |
|
luoluonuoya
|
27ms |
392 KiB |
|
260 Bytes |
2022-5-8 14:03:08 |
|
黄梓桐 (HuangZiTong)
|
27ms |
424 KiB |
|
217 Bytes |
2023-5-25 17:48:10 |
|
何星震 (Jacob)
|
27ms |
384 KiB |
|
183 Bytes |
2022-9-11 9:18:21 |
|
阮 (媚狐不吃道旁李)
|
27ms |
7.2 MiB |
C++98 |
182 Bytes |
2024-5-18 11:12:59 |
|
陈于硕(我™的) (chenyu)
|
27ms |
384 KiB |
|
204 Bytes |
2023-4-8 9:41:48 |
|
chaikexu
|
27ms |
392 KiB |
|
189 Bytes |
2022-9-11 9:21:10 |
|
longhao
|
27ms |
384 KiB |
|
293 Bytes |
2022-1-28 9:40:51 |
|
罗毅川 (scp-049)
|
27ms |
420 KiB |
|
240 Bytes |
2022-2-19 9:23:01 |
|
某某 (xuhaotian)
|
27ms |
384 KiB |
|
202 Bytes |
2022-2-26 14:40:22 |
|
huyinuo
|
27ms |
436 KiB |
|
278 Bytes |
2022-6-27 17:39:57 |
|
ycy
|
27ms |
512 KiB |
|
216 Bytes |
2022-6-29 18:50:34 |
|
芒苒忧 (廖迦南)
|
27ms |
396 KiB |
|
207 Bytes |
2022-2-19 11:17:21 |
|
maobohan
|
27ms |
384 KiB |
|
207 Bytes |
2023-4-29 11:02:46 |
|
向南地
|
27ms |
384 KiB |
|
373 Bytes |
2022-2-19 9:25:33 |
|
赵沛喆
|
28ms |
512 KiB |
|
124 Bytes |
2022-8-5 13:29:18 |
|
zhouzipu
|
28ms |
492 KiB |
|
218 Bytes |
2022-2-19 9:25:07 |
|
lch (凌昌瀚)
|
28ms |
512 KiB |
|
183 Bytes |
2022-8-4 16:05:31 |
|
1396013295
|
28ms |
420 KiB |
|
274 Bytes |
2022-1-23 19:47:13 |
|
李卓燃 (李卓燃1)
|
28ms |
392 KiB |
|
169 Bytes |
2023-3-3 20:54:52 |
|
zhuziyu
|
28ms |
384 KiB |
|
202 Bytes |
2022-2-19 9:24:15 |
|
zhouzipu
|
28ms |
384 KiB |
|
218 Bytes |
2022-2-19 9:19:23 |
|
蒲梓勋 (puzixun)
|
28ms |
384 KiB |
|
221 Bytes |
2022-9-4 11:47:16 |
|
曹埊睿 (caodirui)
|
28ms |
508 KiB |
|
190 Bytes |
2023-4-21 20:13:53 |
|
21035-wyf
|
28ms |
440 KiB |
|
197 Bytes |
2022-2-27 21:02:34 |
|
手搓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 |
512 KiB |
|
185 Bytes |
2023-5-20 13:13:49 |
|
zhouzipu
|
28ms |
392 KiB |
|
218 Bytes |
2022-2-19 9:19:24 |
|
朱泽晟
|
28ms |
512 KiB |
|
131 Bytes |
2022-3-25 21:31:21 |
|
王晨志 (wangchenzhi)
|
29ms |
448 KiB |
|
187 Bytes |
2022-7-17 3:35:31 |
|
廖海宇在追杀马牌痞 (liaohaiyu22031)
|
29ms |
384 KiB |
|
245 Bytes |
2023-1-1 8:47:13 |
|
谭懿轩 (yanyixuan)
|
29ms |
384 KiB |
|
184 Bytes |
2022-2-19 11:02:45 |
|
李书翰 (lishuhan)
|
29ms |
384 KiB |
|
170 Bytes |
2022-4-9 19:42:34 |
|
Tang
|
29ms |
428 KiB |
|
317 Bytes |
2022-8-3 17:03:42 |
|
姚宏逸
|
29ms |
512 KiB |
|
331 Bytes |
2022-2-15 18:31:48 |
|
11111
|
29ms |
384 KiB |
|
237 Bytes |
2022-10-27 17:10:09 |
|
陈杰晟
|
29ms |
512 KiB |
|
206 Bytes |
2022-5-29 11:08:36 |
|
樊竣熠 (lft1114)
|
29ms |
512 KiB |
|
299 Bytes |
2022-8-13 16:27:55 |
|
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)
|
29ms |
6.9 MiB |
|
246 Bytes |
2023-7-12 19:03:34 |
|
11451254188 (22029-mjh)
|
29ms |
512 KiB |
|
260 Bytes |
2023-2-12 20:32:25 |
|
huanglu
|
29ms |
512 KiB |
|
211 Bytes |
2022-9-23 13:32:04 |
|
zhouzipu
|
30ms |
512 KiB |
|
218 Bytes |
2022-2-19 9:19:21 |
|
pandap&a王皓宸 (WANGHAOCHEN)
|
30ms |
512 KiB |
|
349 Bytes |
2023-4-29 16:28:09 |
|
时代二校-陈天成 (鸭缩毛巾)
|
30ms |
6.6 MiB |
|
169 Bytes |
2023-6-3 22:59:20 |
|
周琪渃
|
30ms |
384 KiB |
|
196 Bytes |
2023-3-9 19:10:58 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
30ms |
384 KiB |
|
236 Bytes |
2022-11-15 15:26:02 |
|
时代1校-杨宇轩 (杨宇轩)
|
31ms |
6.7 MiB |
|
203 Bytes |
2023-8-22 12:17:52 |
|
何星震 (Jacob)
|
31ms |
512 KiB |
|
183 Bytes |
2023-3-3 20:47:15 |
|
colin1112 (墙凌可)
|
31ms |
6.7 MiB |
|
171 Bytes |
2023-9-4 20:48:47 |
|
月下的九尾银狐
|
31ms |
6.8 MiB |
|
207 Bytes |
2023-6-17 9:38:19 |
|
繁星 (05c35-zzm)
|
31ms |
512 KiB |
|
192 Bytes |
2022-12-4 10:13:12 |
|
谢欣霖 (xiexinlin)
|
31ms |
436 KiB |
|
202 Bytes |
2022-3-5 15:32:46 |
|
zlx (xiao)
|
31ms |
512 KiB |
|
218 Bytes |
2022-11-27 12:09:38 |
|
罗毅川 (scp-049)
|
31ms |
512 KiB |
|
345 Bytes |
2022-12-2 12:48:01 |
|
scallway
|
31ms |
384 KiB |
|
249 Bytes |
2022-11-11 22:32:05 |
|
周琪渃
|
32ms |
432 KiB |
|
174 Bytes |
2023-3-9 19:09:57 |
|
陈红恺
|
32ms |
6.9 MiB |
|
258 Bytes |
2023-7-18 11:25:13 |
|
重庆龙湖源著校区+杨聆暄 (杨聆暄)
|
32ms |
384 KiB |
|
194 Bytes |
2023-1-18 16:14:50 |
|
李树崑 (lishukun)
|
32ms |
440 KiB |
|
332 Bytes |
2022-11-22 14:38:57 |
|
新壹街校区-杨轩懿 (杨轩懿1)
|
32ms |
7.1 MiB |
|
182 Bytes |
2023-7-21 11:50:49 |
|
小忙果 (王昱杰)
|
33ms |
7.1 MiB |
|
204 Bytes |
2023-7-18 9:18:21 |
|
CK (李弘毅)
|
33ms |
424 KiB |
|
200 Bytes |
2022-11-22 11:20:47 |
|
叶哲宇 (yzy)
|
33ms |
6.8 MiB |
|
148 Bytes |
2023-6-22 18:18:53 |
|
时代一校 - 冯隆浩 (冯隆浩)
|
34ms |
6.8 MiB |
|
196 Bytes |
2023-7-18 10:43:31 |
|
三差学生(尘埃蓝莓) (白佳睿)
|
35ms |
7.2 MiB |
|
216 Bytes |
2023-7-11 10:12:37 |
|
(张洛诚)
|
35ms |
384 KiB |
|
207 Bytes |
2023-4-27 20:41:33 |
|
Tender. (05c05-zhou)
|
38ms |
512 KiB |
|
170 Bytes |
2022-11-25 10:51:56 |
|
黄梓轩 (huangzixuan)
|
42ms |
440 KiB |
|
204 Bytes |
2022-11-28 17:43:19 |
|
我推的乱破 (贺俊楠)
|
43ms |
7.3 MiB |
|
185 Bytes |
2024-1-18 16:47:37 |
|
RanHao
|
135ms |
532 KiB |
|
197 Bytes |
2024-1-26 20:27:12 |
|
老六在此
|
139ms |
764 KiB |
C++20 |
182 Bytes |
2024-10-13 19:06:56 |
|
赵泳鑫 (zhaoyongxin)
|
398ms |
4 MiB |
Python 3 |
208 Bytes |
2022-7-15 15:19:46 |
|
疯神芭芭脱丝 (李卓修)
|
416ms |
4 MiB |
Python 3 |
193 Bytes |
2022-7-14 18:53:46 |
|
梨冻亿 (wiueh)
|
422ms |
3.9 MiB |
Python 3 |
138 Bytes |
2022-1-23 23:03:59 |
|
wzzjnb2012
|
470ms |
3.9 MiB |
Python 3 |
266 Bytes |
2022-11-28 19:33:04 |