|
时代1校-杨宇轩 (杨宇轩)
|
15ms |
7.8 MiB |
|
193 Bytes |
2023-8-22 12:08:32 |
|
徐子恩 (Cow)
|
15ms |
1.1 MiB |
|
265 Bytes |
2022-1-21 16:16:27 |
|
黄立信
|
15ms |
6.9 MiB |
|
262 Bytes |
2023-11-24 19:23:48 |
|
hyh22031
|
15ms |
436 KiB |
|
203 Bytes |
2022-12-25 11:32:27 |
|
缥 (王硕2012)
|
15ms |
436 KiB |
|
288 Bytes |
2023-1-1 9:27:02 |
|
周琪渃
|
15ms |
384 KiB |
|
220 Bytes |
2022-12-10 17:39:23 |
|
欧俊阳
|
15ms |
7.1 MiB |
C++11(O2) |
408 Bytes |
2024-6-15 16:23:26 |
|
朱老师 (zyp)
|
15ms |
432 KiB |
|
476 Bytes |
2022-12-25 9:58:26 |
|
zhm123
|
16ms |
512 KiB |
|
191 Bytes |
2022-10-13 10:56:45 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
16ms |
428 KiB |
|
224 Bytes |
2023-2-19 17:59:08 |
|
Tender. (05c05-zhou)
|
16ms |
512 KiB |
|
203 Bytes |
2022-11-25 10:41:44 |
|
我是周靖松长得帅 (mouyunqi)
|
16ms |
392 KiB |
|
209 Bytes |
2023-3-17 20:05:59 |
|
ycy
|
16ms |
392 KiB |
|
244 Bytes |
2022-12-10 17:35:17 |
|
iLansensei (hjs(Caster))
|
16ms |
428 KiB |
|
236 Bytes |
2022-6-26 11:04:48 |
|
陈风亦 (chenfengyi)
|
16ms |
436 KiB |
|
198 Bytes |
2023-1-18 17:16:07 |
|
邵冠铖 (shaoguancheng22031)
|
16ms |
384 KiB |
|
190 Bytes |
2022-12-25 10:05:34 |
|
朱老师 (zyp)
|
16ms |
432 KiB |
|
476 Bytes |
2022-12-25 10:05:23 |
|
(金沙天街)严皓月 (严皓月)
|
16ms |
7.2 MiB |
|
241 Bytes |
2023-12-30 16:20:01 |
|
zhoumingze23017
|
16ms |
6.7 MiB |
|
212 Bytes |
2023-9-5 18:04:52 |
|
李彦臻
|
16ms |
432 KiB |
|
292 Bytes |
2022-12-25 13:03:06 |
|
22016-lyj
|
16ms |
440 KiB |
|
241 Bytes |
2023-4-16 21:27:04 |
|
漆星语 (qixingyu)
|
16ms |
7.4 MiB |
|
186 Bytes |
2023-7-3 9:33:24 |
|
陈骏逸 (chenjunyi)
|
16ms |
440 KiB |
|
291 Bytes |
2022-8-28 11:36:32 |
|
爱琴海校区-刁钲洋 (刁钲洋)
|
16ms |
7.1 MiB |
|
374 Bytes |
2023-7-3 16:25:46 |
|
源著校区-老师:刘扬-张博涵 (张博涵)
|
16ms |
6.9 MiB |
|
177 Bytes |
2023-8-9 11:37:22 |
|
葛琮扬
|
16ms |
6.9 MiB |
|
265 Bytes |
2023-8-2 16:13:24 |
|
郑岐蔚
|
16ms |
392 KiB |
|
214 Bytes |
2022-12-10 17:29:40 |
|
陈星亦 (cxy01)
|
17ms |
440 KiB |
|
237 Bytes |
2022-12-24 15:30:11 |
|
本人天生贪生pass (05c41-cqs)
|
17ms |
432 KiB |
|
207 Bytes |
2022-10-22 17:56:15 |
|
杨坤霖 (steven)
|
17ms |
440 KiB |
|
227 Bytes |
2023-1-8 9:23:31 |
|
新壹街校区-杨轩懿 (杨轩懿1)
|
17ms |
6.9 MiB |
|
181 Bytes |
2023-7-22 10:33:30 |
|
张祖名
|
17ms |
7 MiB |
|
222 Bytes |
2023-11-19 19:15:08 |
|
三差学生(尘埃蓝莓) (白佳睿)
|
17ms |
7.4 MiB |
|
198 Bytes |
2023-7-11 10:09:19 |
|
xyc (谢雨宸)
|
17ms |
7.5 MiB |
|
189 Bytes |
2023-7-10 19:10:09 |
|
高彬月
|
17ms |
6.5 MiB |
|
209 Bytes |
2023-11-19 14:38:02 |
|
手搓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)
|
17ms |
6.9 MiB |
|
276 Bytes |
2023-8-10 10:21:39 |
|
陌生人 (涂玉龙)
|
17ms |
6.5 MiB |
|
211 Bytes |
2023-11-19 14:38:24 |
|
重庆龙湖源著校区+杨聆暄 (杨聆暄)
|
17ms |
440 KiB |
|
244 Bytes |
2023-1-18 15:05:14 |
|
樊竣熠 (lft1114)
|
17ms |
440 KiB |
|
218 Bytes |
2022-8-20 13:31:40 |
|
新壹街校区-老师: 黄路 (陈星宇)
|
18ms |
6.9 MiB |
|
214 Bytes |
2023-12-1 19:09: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)
|
19ms |
8.2 MiB |
|
326 Bytes |
2023-8-23 18:22:57 |
|
colin1112 (墙凌可)
|
19ms |
444 KiB |
|
210 Bytes |
2023-4-20 11:52:41 |
|
hzm
|
20ms |
444 KiB |
|
201 Bytes |
2022-9-15 22:34:01 |
|
200800
|
20ms |
6.5 MiB |
|
195 Bytes |
2023-11-19 14:39:41 |
|
原著校区 巫映秋 (巫映秋1a)
|
20ms |
6.8 MiB |
|
194 Bytes |
2023-11-24 21:59:40 |
|
关博源
|
20ms |
444 KiB |
|
262 Bytes |
2023-4-27 18:59:06 |
|
段淏泷 (林皓轩)
|
20ms |
7.2 MiB |
|
211 Bytes |
2024-1-19 15:44:54 |
|
22016-oyc
|
21ms |
412 KiB |
|
217 Bytes |
2022-9-11 10:02:40 |
|
龙湖时代C馆-邹镇宇 (邹镇宇)
|
21ms |
7 MiB |
|
214 Bytes |
2023-12-8 23:43:37 |
|
黄梓轩 (huangzixuan)
|
22ms |
428 KiB |
|
202 Bytes |
2022-11-28 17:40:48 |
|
朱泽晟
|
22ms |
512 KiB |
|
337 Bytes |
2022-8-30 16:50:12 |
|
hrz
|
23ms |
6.5 MiB |
|
224 Bytes |
2023-11-19 14:38:27 |
|
Guest
|
23ms |
7 MiB |
|
283 Bytes |
2024-1-19 15:40:04 |
|
wangjun
|
23ms |
6.9 MiB |
|
187 Bytes |
2023-11-26 17:56:05 |
|
wangzihang
|
24ms |
6.9 MiB |
|
209 Bytes |
2023-12-16 21:03:36 |
|
颜梓宇
|
25ms |
7.1 MiB |
|
199 Bytes |
2024-1-7 17:23:13 |
|
刘煜轩
|
25ms |
6.8 MiB |
|
353 Bytes |
2023-11-29 21:07:49 |
|
zcx
|
26ms |
7 MiB |
|
188 Bytes |
2023-12-3 11:08:02 |
|
程曦漫
|
30ms |
6.5 MiB |
|
203 Bytes |
2023-11-19 14:40:21 |
|
易锦程 (sky)
|
33ms |
7.1 MiB |
|
257 Bytes |
2023-12-6 22:42:25 |
|
22029-lyh
|
41ms |
7 MiB |
|
305 Bytes |
2023-12-3 10:48:16 |
|
Billy52013 (李子轩)
|
56ms |
548 KiB |
|
189 Bytes |
2024-3-9 20:16:15 |
|
yuchenyi23017
|
59ms |
764 KiB |
|
209 Bytes |
2024-1-28 15:44:38 |
|
新壹街+黄路+江宇轩 (江宇轩)
|
61ms |
764 KiB |
|
201 Bytes |
2024-4-3 21:39:18 |
|
许律天
|
64ms |
760 KiB |
|
176 Bytes |
2024-2-29 21:46:06 |
|
U城校区-邓皓月 (邓皓月)
|
64ms |
532 KiB |
|
248 Bytes |
2024-2-19 19:27:57 |
|
wanghaixi xxx
|
65ms |
768 KiB |
C++98 |
252 Bytes |
2024-9-5 13:01:56 |
|
陌生人 (涂玉龙)
|
65ms |
536 KiB |
|
183 Bytes |
2024-3-2 14:51:10 |
|
新壹街-李昕宇 (李昕宇)
|
65ms |
764 KiB |
C++11 |
291 Bytes |
2024-9-13 17:27:03 |
|
源著校区-刘洋-付柏乐 (付柏乐)
|
65ms |
764 KiB |
C++11 |
210 Bytes |
2024-11-10 17:05:26 |
|
赵奕铭
|
66ms |
532 KiB |
|
176 Bytes |
2024-3-2 14:52:00 |
|
陈家熠
|
67ms |
532 KiB |
C++11 |
297 Bytes |
2024-11-10 17:07:44 |
|
tongxiao
|
67ms |
532 KiB |
|
262 Bytes |
2024-3-21 19:05:32 |
|
杨哲羽
|
67ms |
768 KiB |
|
195 Bytes |
2024-3-24 11:55:20 |
|
许皓宸
|
67ms |
768 KiB |
C++98 |
220 Bytes |
2024-8-31 14:09:00 |
|
王俪熹
|
68ms |
532 KiB |
|
198 Bytes |
2024-3-30 17:30:47 |
|
zyl
|
68ms |
532 KiB |
|
305 Bytes |
2024-2-2 15:35:56 |
|
陈信
|
68ms |
540 KiB |
C++98(O2) |
213 Bytes |
2024-9-25 20:24:57 |
|
何煜琦
|
68ms |
764 KiB |
C++11 |
186 Bytes |
2024-10-28 20:01:18 |
|
U城校区-郭旻哲 (郭旻哲)
|
68ms |
764 KiB |
|
179 Bytes |
2024-3-2 14:51:21 |
|
My name is Man (钟卓劭)
|
69ms |
532 KiB |
|
418 Bytes |
2024-3-19 14:56:21 |
|
周浩楠 (开朗的周好难)
|
69ms |
548 KiB |
C++11 |
262 Bytes |
2024-11-10 17:42:47 |
|
U城校区-漆子轩 (叶子小七)
|
69ms |
764 KiB |
|
200 Bytes |
2024-3-2 14:50:27 |
|
熊希龄
|
69ms |
532 KiB |
C++98(O2) |
211 Bytes |
2024-8-31 13:55:08 |
|
Nico
|
69ms |
536 KiB |
|
214 Bytes |
2024-3-16 18:23:05 |
|
吴佳智 (AWM)
|
70ms |
556 KiB |
C++98 |
256 Bytes |
2024-11-17 16:09:19 |
|
xiongxiling
|
70ms |
532 KiB |
C++11 |
211 Bytes |
2024-8-31 13:55:47 |
|
liuyixuan
|
70ms |
764 KiB |
C++11 |
216 Bytes |
2024-8-31 13:55:00 |
|
douchenmeng
|
70ms |
764 KiB |
C++98 |
227 Bytes |
2024-8-31 13:59:16 |
|
吴子逸
|
70ms |
532 KiB |
C++98 |
226 Bytes |
2024-11-24 20:50:55 |
|
stehpen_zuo
|
70ms |
552 KiB |
C++20 |
284 Bytes |
2024-9-25 14:30:34 |
|
jdy
|
71ms |
768 KiB |
|
211 Bytes |
2024-3-6 15:25:50 |
|
郑隽霖
|
71ms |
544 KiB |
C++17 |
214 Bytes |
2024-9-2 10:22:25 |
|
雷诺伊尔 (崔金鹏)
|
71ms |
540 KiB |
C++20 |
215 Bytes |
2024-11-10 16:10:02 |
|
高彬月
|
71ms |
764 KiB |
|
202 Bytes |
2024-3-2 14:52:54 |
|
ysf.wlanwq.ZJSWL 1922~1991 (韦舒豪)
|
71ms |
532 KiB |
C++11(O2) |
290 Bytes |
2024-10-18 22:33:16 |
|
许徐非凡 (非同凡响)
|
71ms |
792 KiB |
C++98 |
239 Bytes |
2024-10-11 19:43:11 |
|
曹雅萱
|
72ms |
784 KiB |
C++11 |
225 Bytes |
2024-11-9 11:26:58 |
|
hrz
|
72ms |
548 KiB |
|
196 Bytes |
2024-3-2 14:52:42 |
|
Accepted (周芷乐)
|
72ms |
764 KiB |
C++14 |
222 Bytes |
2024-10-5 11:20:12 |