|
赵沛喆
|
6ms |
316 KiB |
|
210 Bytes |
2022-4-16 13:24:31 |
|
杨坤霖 (steven)
|
7ms |
312 KiB |
|
204 Bytes |
2023-4-30 16:32:19 |
|
zyl
|
8ms |
7.3 MiB |
|
182 Bytes |
2024-1-21 14:19:13 |
|
郑尧 (zhengyao)
|
11ms |
7.1 MiB |
C++98 |
180 Bytes |
2024-6-29 14:25:03 |
|
新壹街 朱启航 (zhuqihang)
|
11ms |
7.1 MiB |
|
198 Bytes |
2024-1-23 8:30:07 |
|
xiongxinyao
|
11ms |
392 KiB |
|
311 Bytes |
2022-7-1 11:27:10 |
|
姚宏逸
|
11ms |
384 KiB |
|
238 Bytes |
2022-5-30 16:17:44 |
|
郭人瑀
|
11ms |
384 KiB |
|
180 Bytes |
2022-9-11 16:56:09 |
|
张瑞博
|
11ms |
7.2 MiB |
C++11 |
170 Bytes |
2024-5-5 22:07:54 |
|
22029-lyh
|
11ms |
384 KiB |
|
203 Bytes |
2023-5-17 17:53:39 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
11ms |
384 KiB |
|
172 Bytes |
2022-7-4 9:39:16 |
|
时代一校-赵彦博 (zyb)
|
11ms |
384 KiB |
|
193 Bytes |
2023-5-7 13:22:25 |
|
时代一校-王宥量 (wangyouliang)
|
11ms |
6.8 MiB |
C++98(O2) |
188 Bytes |
2024-6-29 14:13:07 |
|
huyinuo
|
11ms |
384 KiB |
|
166 Bytes |
2022-4-18 18:43:02 |
|
李树崑 (lishukun)
|
11ms |
384 KiB |
|
249 Bytes |
2022-6-25 20:35:39 |
|
杜是贤 (dushixian)
|
11ms |
384 KiB |
|
187 Bytes |
2022-7-1 16:01:10 |
|
ttt123
|
11ms |
384 KiB |
|
203 Bytes |
2022-6-28 22:56:46 |
|
My name is Man (钟卓劭)
|
11ms |
7.2 MiB |
C++98 |
143 Bytes |
2024-4-26 17:32:11 |
|
唐良瑞 (22016-tlr01)
|
11ms |
384 KiB |
|
198 Bytes |
2023-2-26 12:07:51 |
|
经常消失 (小萝卜)
|
11ms |
392 KiB |
|
201 Bytes |
2022-6-25 21:17:27 |
|
李哲 (lizhe)
|
11ms |
7.1 MiB |
C++98 |
167 Bytes |
2024-6-29 14:18:58 |
|
火爆肥肠(杨弘毅) (火爆肥肠)
|
11ms |
384 KiB |
|
214 Bytes |
2022-5-11 21:08:22 |
|
05c05-hzy
|
11ms |
392 KiB |
|
190 Bytes |
2023-2-26 12:00:07 |
|
TBB (杜昊燃)
|
11ms |
400 KiB |
|
163 Bytes |
2022-4-9 23:03:37 |
|
李倾城的忠实假粉 (向熠可)
|
11ms |
384 KiB |
|
196 Bytes |
2022-3-29 21:19:22 |
|
22016-yzq
|
11ms |
384 KiB |
|
179 Bytes |
2023-2-26 11:39:36 |
|
旷山 (15213268688)
|
11ms |
392 KiB |
|
197 Bytes |
2022-7-1 21:35:46 |
|
曾御城(现用名) (Jason)
|
12ms |
416 KiB |
|
253 Bytes |
2022-1-24 16:44:30 |
|
1396013295
|
12ms |
384 KiB |
|
218 Bytes |
2022-1-25 16:53:41 |
|
杜俊宏
|
12ms |
384 KiB |
|
178 Bytes |
2022-4-3 14:05:18 |
|
傅博涛
|
12ms |
384 KiB |
|
209 Bytes |
2022-5-15 11:15:17 |
|
甄一阳 (22016-zyy)
|
12ms |
384 KiB |
|
193 Bytes |
2023-2-26 11:39:40 |
|
郑尧 (zhengyao)
|
12ms |
7.1 MiB |
C++98 |
178 Bytes |
2024-6-29 14:14:40 |
|
_PXY_
|
12ms |
392 KiB |
|
202 Bytes |
2022-1-23 11:23:41 |
|
王浚西 (22016-wjx)
|
12ms |
392 KiB |
|
185 Bytes |
2023-2-26 12:09:18 |
|
17779
|
12ms |
384 KiB |
|
235 Bytes |
2022-4-18 14:49:05 |
|
何昊宇 (22016-hhy)
|
12ms |
384 KiB |
|
242 Bytes |
2023-2-26 11:46:17 |
|
文硕 (文硕1)
|
12ms |
388 KiB |
|
204 Bytes |
2022-7-12 13:41:44 |
|
luoluonuoya
|
12ms |
384 KiB |
|
244 Bytes |
2022-3-27 15:08:16 |
|
jdy
|
12ms |
384 KiB |
|
173 Bytes |
2022-5-15 11:22:21 |
|
王子睿
|
12ms |
6.6 MiB |
C++98 |
145 Bytes |
2024-7-16 21:18:03 |
|
啊...这 (炼狱杏寿郎)
|
12ms |
420 KiB |
|
171 Bytes |
2022-6-29 16:06:50 |
|
梅子楠 (22016-mzn)
|
12ms |
512 KiB |
|
183 Bytes |
2023-5-25 21:26:09 |
|
没有此人 (akm)
|
12ms |
384 KiB |
|
189 Bytes |
2023-4-22 18:20:50 |
|
褚博艺
|
12ms |
7 MiB |
C++11 |
182 Bytes |
2024-6-8 16:08:31 |
|
陈骏洋
|
12ms |
388 KiB |
|
198 Bytes |
2022-5-15 11:31:21 |
|
xiangsiyu
|
12ms |
520 KiB |
|
186 Bytes |
2022-7-3 22:08:02 |
|
陈杰晟
|
12ms |
420 KiB |
|
229 Bytes |
2022-3-24 13:49:08 |
|
手搓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)
|
12ms |
384 KiB |
|
170 Bytes |
2023-5-12 19:35:29 |
|
德意志第三帝国 (陈远桥)
|
12ms |
384 KiB |
|
188 Bytes |
2022-5-15 11:30:25 |
|
谢佳辰
|
12ms |
392 KiB |
|
184 Bytes |
2022-5-15 11:26:43 |
|
梨冻亿 (wiueh)
|
12ms |
392 KiB |
|
244 Bytes |
2022-1-23 20:12:57 |
|
zcx
|
12ms |
392 KiB |
|
223 Bytes |
2023-5-15 19:52:10 |
|
王韵淮
|
12ms |
384 KiB |
|
164 Bytes |
2022-5-15 10:58:32 |
|
22016-ywb01
|
12ms |
392 KiB |
|
154 Bytes |
2023-2-26 12:09:24 |
|
时代二校-焦雨齐 (Angel)
|
12ms |
6.9 MiB |
|
231 Bytes |
2023-10-14 18:06:16 |
|
廖海宇在追杀马牌痞 (liaohaiyu22031)
|
12ms |
384 KiB |
|
191 Bytes |
2023-5-14 10:26:05 |
|
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)
|
12ms |
6.7 MiB |
|
262 Bytes |
2023-9-27 22:07:37 |
|
李金珂
|
12ms |
512 KiB |
|
146 Bytes |
2022-8-12 13:53:47 |
|
何昊宇 (22016-hhy)
|
12ms |
384 KiB |
|
227 Bytes |
2023-2-26 11:46:06 |
|
22016-oyc
|
12ms |
384 KiB |
|
259 Bytes |
2023-2-26 11:53:20 |
|
祝熙承 (zxc)
|
12ms |
6.7 MiB |
C++98 |
181 Bytes |
2024-7-11 13:07:14 |
|
谢博文
|
12ms |
384 KiB |
|
186 Bytes |
2022-6-25 11:20:47 |
|
(张洛诚)
|
12ms |
384 KiB |
|
226 Bytes |
2023-4-20 19:30:58 |
|
霍弈丞小号
|
12ms |
432 KiB |
|
206 Bytes |
2023-4-16 17:21:21 |
|
余龙恩---来自额嘛瑞卡 (yulongenshijieshangzuishuai)
|
12ms |
412 KiB |
|
265 Bytes |
2022-1-23 10:53:22 |
|
赵泳鑫 (zhaoyongxin)
|
12ms |
512 KiB |
|
188 Bytes |
2022-6-6 20:56:09 |
|
Randy Marsh (杨子腾)
|
12ms |
384 KiB |
|
201 Bytes |
2022-5-15 11:26:29 |
|
中岛敦 (黄麒瑞)
|
12ms |
6.8 MiB |
|
163 Bytes |
2023-10-20 18:57:11 |
|
林小博
|
12ms |
384 KiB |
|
228 Bytes |
2022-12-3 14:03:21 |
|
luosifu22006
|
12ms |
392 KiB |
|
212 Bytes |
2022-10-30 18:48:21 |
|
我推的乱破 (贺俊楠)
|
12ms |
384 KiB |
|
153 Bytes |
2023-4-13 20:15:14 |
|
kql1
|
12ms |
7.1 MiB |
C++98 |
204 Bytes |
2024-5-9 13:37:21 |
|
renqiumo
|
12ms |
384 KiB |
|
348 Bytes |
2022-4-10 16:05:04 |
|
赵鑫宸 (xiaoxiao721)
|
12ms |
440 KiB |
|
235 Bytes |
2022-3-23 17:24:53 |
|
Tang
|
12ms |
384 KiB |
|
154 Bytes |
2022-6-25 11:22:08 |
|
蒋青峰
|
12ms |
440 KiB |
|
167 Bytes |
2023-5-7 20:50:15 |
|
22016-lyj
|
12ms |
440 KiB |
|
181 Bytes |
2023-2-26 12:24:16 |
|
缥 (王硕2012)
|
12ms |
384 KiB |
|
187 Bytes |
2023-5-13 19:45:04 |
|
05c30-dyh
|
12ms |
512 KiB |
|
179 Bytes |
2022-2-26 16:00:34 |
|
scallway
|
13ms |
7 MiB |
|
228 Bytes |
2023-12-22 15:34:50 |
|
芒苒忧 (廖迦南)
|
13ms |
512 KiB |
|
266 Bytes |
2022-3-1 19:31:19 |
|
我推的乱破 (贺俊楠)
|
13ms |
6.9 MiB |
|
240 Bytes |
2023-10-22 18:45:35 |
|
王韵淮
|
13ms |
388 KiB |
|
183 Bytes |
2022-4-5 11:46:40 |
|
汪致卉 (wangzh)
|
13ms |
432 KiB |
|
231 Bytes |
2022-2-18 18:27:54 |
|
庹仕杰
|
13ms |
6.7 MiB |
|
209 Bytes |
2023-10-1 10:42:17 |
|
Jose (反恐皮蛋)
|
13ms |
428 KiB |
|
372 Bytes |
2022-7-27 8:37:00 |
|
李山水
|
13ms |
512 KiB |
|
224 Bytes |
2022-7-30 11:48:50 |
|
Yuan (Zongzi1)
|
13ms |
6.6 MiB |
C++17(O2) |
173 Bytes |
2024-7-27 19:34:06 |
|
朱老师 (zyp)
|
13ms |
392 KiB |
|
193 Bytes |
2022-10-30 18:48:29 |
|
zhouzipu
|
13ms |
428 KiB |
|
292 Bytes |
2022-8-17 15:12:21 |
|
朱泽晟
|
13ms |
384 KiB |
|
196 Bytes |
2022-8-25 19:47:14 |
|
樊竣熠 (lft1114)
|
13ms |
424 KiB |
|
187 Bytes |
2022-2-28 18:51:55 |
|
时代二校-陈天成 (鸭缩毛巾)
|
13ms |
6.8 MiB |
|
139 Bytes |
2023-10-21 15:10:30 |
|
jdy
|
13ms |
392 KiB |
|
245 Bytes |
2022-12-3 14:03:53 |
|
王晨志 (wangchenzhi)
|
13ms |
392 KiB |
|
444 Bytes |
2022-2-1 1:59:39 |
|
zhuqiwei22006
|
13ms |
392 KiB |
|
170 Bytes |
2022-10-30 18:50:23 |
|
12345
|
13ms |
432 KiB |
|
210 Bytes |
2022-6-29 16:05:47 |
|
zhm123
|
13ms |
440 KiB |
|
181 Bytes |
2023-5-8 20:49:09 |
|
AAA? Prow max (hechenxuan23005)
|
13ms |
7 MiB |
C++98 |
206 Bytes |
2024-6-15 16:16:20 |