|
姚宏逸
|
6ms |
264 KiB |
|
211 Bytes |
2022-5-30 16:08:51 |
|
赵沛喆
|
6ms |
256 KiB |
|
179 Bytes |
2022-4-3 9:43:03 |
|
1396013295
|
7ms |
312 KiB |
|
267 Bytes |
2022-1-22 18:17:09 |
|
wangzihang
|
7ms |
312 KiB |
|
196 Bytes |
2022-8-5 10:00:10 |
|
wangruibo20xh
|
7ms |
308 KiB |
|
196 Bytes |
2022-2-11 14:24:33 |
|
黄梓桐 (HuangZiTong)
|
12ms |
384 KiB |
|
201 Bytes |
2022-7-31 18:04:53 |
|
原著校区 巫映秋 (巫映秋1a)
|
13ms |
7 MiB |
C++98 |
242 Bytes |
2024-6-28 22:42:01 |
|
Yuan (Zongzi1)
|
13ms |
6.6 MiB |
C++17(O2) |
240 Bytes |
2024-7-18 10:12:04 |
|
文硕 (文硕1)
|
13ms |
392 KiB |
|
256 Bytes |
2022-7-12 11:38:28 |
|
maomao
|
13ms |
384 KiB |
|
269 Bytes |
2022-5-25 20:22:08 |
|
tad (OP AI)
|
13ms |
6.9 MiB |
C++11 |
177 Bytes |
2024-7-1 21:42:13 |
|
zlx (xiao)
|
13ms |
512 KiB |
|
268 Bytes |
2022-8-9 11:29:17 |
|
时代校区-孔令皓 (konglinghao)
|
13ms |
7.1 MiB |
C++98 |
1.1 KiB |
2024-4-23 22:32:20 |
|
22016-ggs
|
13ms |
436 KiB |
|
216 Bytes |
2022-8-16 16:11:00 |
|
无尽的想象 (谭仕高)
|
13ms |
456 KiB |
|
179 Bytes |
2022-7-29 13:21:56 |
|
谭懿轩 (yanyixuan)
|
13ms |
384 KiB |
|
161 Bytes |
2022-1-3 18:19:39 |
|
任瑞 的 学生 (jiangyadong)
|
13ms |
392 KiB |
|
203 Bytes |
2022-6-19 13:18:01 |
|
时代校区-孔令皓 (konglinghao)
|
13ms |
7.1 MiB |
C++98 |
1.1 KiB |
2024-4-23 22:32:42 |
|
张瑞博
|
13ms |
7.3 MiB |
C++11 |
201 Bytes |
2024-5-18 11:46:43 |
|
huyinuo
|
13ms |
384 KiB |
|
205 Bytes |
2022-3-20 17:50:15 |
|
zhangyh (张育菡)
|
13ms |
512 KiB |
|
172 Bytes |
2022-6-10 22:32:46 |
|
爱琴海校区-刁钲洋 (刁钲洋)
|
13ms |
7.2 MiB |
C++98 |
218 Bytes |
2024-5-5 14:13:38 |
|
阮 (媚狐不吃道旁李)
|
13ms |
6.8 MiB |
C++98 |
161 Bytes |
2024-5-25 16:31:26 |
|
我推的乱破 (贺俊楠)
|
13ms |
7.2 MiB |
C++98 |
183 Bytes |
2024-4-25 20:45:27 |
|
赵泳鑫 (zhaoyongxin)
|
13ms |
440 KiB |
|
256 Bytes |
2022-7-12 11:24:27 |
|
ycy
|
14ms |
440 KiB |
|
204 Bytes |
2022-6-16 17:05:43 |
|
qinyi
|
14ms |
444 KiB |
|
162 Bytes |
2022-3-9 19:02:56 |
|
时代校区-孔令皓 (konglinghao)
|
14ms |
7.1 MiB |
C++98 |
1.1 KiB |
2024-4-23 22:32:36 |
|
芒苒忧 (廖迦南)
|
14ms |
384 KiB |
|
211 Bytes |
2022-1-26 20:38:19 |
|
ywh
|
14ms |
440 KiB |
|
200 Bytes |
2022-7-18 17:20:11 |
|
heyi
|
14ms |
6.8 MiB |
C++98(O2) |
275 Bytes |
2024-8-10 10:49:19 |
|
qwerty
|
14ms |
440 KiB |
|
226 Bytes |
2022-3-12 19:43:29 |
|
廖海宇在追杀马牌痞 (liaohaiyu22031)
|
14ms |
392 KiB |
|
214 Bytes |
2023-5-11 22:22:55 |
|
yiqiuyu
|
14ms |
384 KiB |
|
190 Bytes |
2023-3-25 20:13:01 |
|
Erin
|
14ms |
7 MiB |
C++98 |
167 Bytes |
2024-5-5 11:00:31 |
|
luoluonuoya
|
14ms |
424 KiB |
|
168 Bytes |
2022-8-15 14:21:56 |
|
疯神芭芭脱丝 (李卓修)
|
14ms |
384 KiB |
|
241 Bytes |
2022-4-5 16:45:03 |
|
张瑞博
|
14ms |
7.4 MiB |
C++11 |
208 Bytes |
2024-5-18 11:44:56 |
|
colin1112 (墙凌可)
|
14ms |
6.7 MiB |
|
556 Bytes |
2023-8-30 15:41:46 |
|
王晨志 (wangchenzhi)
|
14ms |
512 KiB |
|
449 Bytes |
2022-6-30 18:04:32 |
|
李彦臻
|
14ms |
6.8 MiB |
|
170 Bytes |
2023-10-4 10:11:07 |
|
吴俊成 (wujuncheng)
|
14ms |
444 KiB |
|
217 Bytes |
2022-7-10 12:37:17 |
|
lafuzbc
|
14ms |
384 KiB |
|
164 Bytes |
2022-9-3 20:18:58 |
|
朱老师 (zyp)
|
14ms |
460 KiB |
|
200 Bytes |
2022-8-6 15:36:08 |
|
zzl
|
14ms |
6.8 MiB |
|
188 Bytes |
2023-11-7 1:04:43 |
|
SYC0226
|
14ms |
440 KiB |
|
208 Bytes |
2022-3-20 13:11:23 |
|
黄梓桐 (HuangZiTong)
|
14ms |
452 KiB |
|
189 Bytes |
2022-7-31 18:04:40 |
|
胡宸华 (huchenhua)
|
14ms |
384 KiB |
|
192 Bytes |
2022-11-13 8:59:14 |
|
(张洛诚)
|
14ms |
384 KiB |
|
190 Bytes |
2023-5-4 20:37:32 |
|
黄立信
|
14ms |
7 MiB |
|
396 Bytes |
2023-10-15 14:00:29 |
|
Tender. (05c05-zhou)
|
14ms |
436 KiB |
|
255 Bytes |
2023-2-17 20:12:43 |
|
伍行念 (wuxingnian)
|
14ms |
6.8 MiB |
|
182 Bytes |
2023-9-29 14:55:50 |
|
scallway
|
14ms |
444 KiB |
|
191 Bytes |
2022-9-15 16:33:03 |
|
我全家SB!!! 我没母!!! (baijinlin)
|
14ms |
392 KiB |
|
193 Bytes |
2023-3-25 16:32:00 |
|
经常消失 (小萝卜)
|
14ms |
436 KiB |
|
203 Bytes |
2022-2-19 14:06:48 |
|
NJL (NJlL)
|
15ms |
440 KiB |
|
193 Bytes |
2022-7-6 14:54:00 |
|
吃小孩的viv_
|
15ms |
488 KiB |
|
178 Bytes |
2022-8-27 14:27:05 |
|
曹埊睿 (caodirui)
|
15ms |
512 KiB |
|
216 Bytes |
2023-4-18 18:39:29 |
|
陈杰晟
|
15ms |
432 KiB |
|
203 Bytes |
2022-2-23 17:03:30 |
|
我全家SB!!! 我没母!!! (baijinlin)
|
15ms |
392 KiB |
|
193 Bytes |
2023-3-25 16:49:15 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
15ms |
392 KiB |
|
241 Bytes |
2022-11-2 19:04:57 |
|
我全家SB!!! 我没母!!! (baijinlin)
|
15ms |
436 KiB |
|
193 Bytes |
2023-3-25 16:49:15 |
|
手搓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)
|
15ms |
400 KiB |
|
235 Bytes |
2023-5-27 15:48:23 |
|
龙湖时代C馆-邹镇宇 (邹镇宇)
|
15ms |
6.7 MiB |
|
186 Bytes |
2023-8-26 12:45:56 |
|
yanglang
|
15ms |
436 KiB |
|
170 Bytes |
2022-10-23 10:56:27 |
|
李山水
|
15ms |
384 KiB |
|
301 Bytes |
2022-8-26 20:04:19 |
|
张祖名
|
15ms |
6.7 MiB |
|
206 Bytes |
2023-8-30 13:57:40 |
|
向俊熙 (xiangjunxi23003)
|
15ms |
384 KiB |
|
202 Bytes |
2023-3-25 16:30:07 |
|
周琪渃
|
15ms |
6.7 MiB |
|
186 Bytes |
2023-9-8 21:28:32 |
|
时代一校-赵彦博 (zyb)
|
15ms |
8.1 MiB |
|
158 Bytes |
2023-8-25 16:12:26 |
|
周琪渃
|
15ms |
6.7 MiB |
|
203 Bytes |
2023-9-8 21:29:14 |
|
繁星 (05c35-zzm)
|
16ms |
436 KiB |
|
215 Bytes |
2022-11-28 8:57:41 |
|
lch (凌昌瀚)
|
16ms |
432 KiB |
|
191 Bytes |
2022-8-25 16:38:10 |
|
pandap&a王皓宸 (WANGHAOCHEN)
|
16ms |
392 KiB |
|
181 Bytes |
2022-12-14 20:18:00 |
|
Nico
|
16ms |
6.8 MiB |
|
210 Bytes |
2023-6-22 11:03:22 |
|
wzzjnb2012
|
16ms |
444 KiB |
|
278 Bytes |
2022-10-3 8:12:00 |
|
我全家SB!!! 我没母!!! (baijinlin)
|
16ms |
436 KiB |
|
193 Bytes |
2023-3-25 16:31:57 |
|
重庆龙湖源著校区+杨聆暄 (杨聆暄)
|
16ms |
440 KiB |
|
197 Bytes |
2023-1-14 15:20:34 |
|
蒲梓勋 (puzixun)
|
16ms |
6.9 MiB |
|
206 Bytes |
2023-8-14 22:17:48 |
|
RanHao
|
16ms |
6.9 MiB |
|
174 Bytes |
2023-7-22 18:23:58 |
|
时代校区-刘臣原 (微笑王子)
|
16ms |
512 KiB |
|
168 Bytes |
2022-12-19 21:07:49 |
|
huanglu
|
16ms |
6.9 MiB |
|
204 Bytes |
2023-7-18 10:45:06 |
|
葛琮扬
|
17ms |
6.9 MiB |
|
170 Bytes |
2023-8-4 16:04:42 |
|
ganlin1
|
17ms |
6.9 MiB |
|
177 Bytes |
2023-7-27 10:15:39 |
|
chen (peter)
|
18ms |
436 KiB |
|
191 Bytes |
2022-8-26 17:23:20 |
|
谭红中 (不知道)
|
18ms |
440 KiB |
|
171 Bytes |
2023-1-14 12:05:55 |
|
呵呵呵 (陈思琦)
|
18ms |
440 KiB |
|
174 Bytes |
2022-9-17 17:11:15 |
|
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 |
392 KiB |
|
191 Bytes |
2023-4-15 16:46:03 |
|
时代一校-王宥量 (wangyouliang)
|
19ms |
436 KiB |
|
167 Bytes |
2022-10-16 11:48:14 |
|
wangjun
|
24ms |
7.2 MiB |
|
186 Bytes |
2023-11-19 11:32:29 |
|
CK (李弘毅)
|
25ms |
7 MiB |
|
183 Bytes |
2023-11-12 13:35:31 |
|
贾博涵
|
25ms |
6.6 MiB |
|
172 Bytes |
2023-11-22 9:59:59 |
|
新壹街陈科言 (cky)
|
25ms |
7.4 MiB |
|
297 Bytes |
2023-7-20 14:27:14 |
|
zyl
|
27ms |
7.3 MiB |
|
177 Bytes |
2024-1-4 10:36:50 |
|
没有此人 (akm)
|
31ms |
7 MiB |
|
205 Bytes |
2023-12-23 14:51:21 |
|
杜俊宏
|
37ms |
432 KiB |
|
241 Bytes |
2022-6-19 13:19:34 |
|
新壹街校区-冉睦阳 (冉睦阳)
|
64ms |
536 KiB |
C++98 |
179 Bytes |
2024-9-10 10:41:08 |
|
yyds (杨骐嘉)
|
65ms |
764 KiB |
|
179 Bytes |
2024-3-28 20:00:05 |
|
JOKER (hhy)
|
67ms |
768 KiB |
|
230 Bytes |
2024-1-27 20:04:25 |
|
杨博文05
|
67ms |
532 KiB |
C++98 |
168 Bytes |
2024-9-6 15:48:02 |