|
zzzrrrxxx
|
- |
7 MiB |
|
223 Bytes |
2023-12-17 16:55:21 |
|
11111
|
4ms |
264 KiB |
|
252 Bytes |
2022-6-1 18:43:57 |
|
zyl
|
7ms |
7 MiB |
|
248 Bytes |
2023-12-28 16:03:37 |
|
爱琴海校区-黄辰浩 (huangchenhao)
|
8ms |
384 KiB |
|
255 Bytes |
2023-2-12 15:33:35 |
|
李树崑 (lishukun)
|
8ms |
384 KiB |
|
332 Bytes |
2022-4-30 13:40:44 |
|
zhangxinchen
|
8ms |
392 KiB |
|
329 Bytes |
2022-6-18 15:25:33 |
|
panyan
|
8ms |
384 KiB |
|
274 Bytes |
2022-6-18 15:16:45 |
|
miku (阳沐珊)
|
9ms |
392 KiB |
|
262 Bytes |
2022-6-11 12:03:07 |
|
吴思谛 (wusidi)
|
9ms |
384 KiB |
|
356 Bytes |
2022-6-11 12:05:25 |
|
17779
|
9ms |
384 KiB |
|
309 Bytes |
2022-4-11 14:45:45 |
|
xuniaoyin (徐袅音)
|
9ms |
384 KiB |
|
263 Bytes |
2023-2-12 15:33:59 |
|
yanxiaosong
|
9ms |
384 KiB |
|
326 Bytes |
2022-6-18 15:21:24 |
|
胡瀚文
|
9ms |
512 KiB |
|
234 Bytes |
2022-7-15 17:57:30 |
|
陈风亦 (chenfengyi)
|
9ms |
508 KiB |
|
244 Bytes |
2022-6-18 15:13:27 |
|
吴俊成 (wujuncheng)
|
9ms |
392 KiB |
|
299 Bytes |
2022-7-11 11:32:33 |
|
火爆肥肠(杨弘毅) (火爆肥肠)
|
9ms |
384 KiB |
|
306 Bytes |
2022-4-20 20:56:13 |
|
朱老师 (zyp)
|
9ms |
432 KiB |
|
463 Bytes |
2022-8-16 18:32:26 |
|
魑归sama
|
9ms |
440 KiB |
|
291 Bytes |
2022-7-12 16:47:44 |
|
Yuan (Zongzi1)
|
9ms |
6.6 MiB |
C++17(O2) |
278 Bytes |
2024-7-21 15:29:50 |
|
kim
|
9ms |
384 KiB |
|
293 Bytes |
2023-3-3 20:47:04 |
|
张祖名
|
9ms |
6.4 MiB |
C++98(O2) |
304 Bytes |
2024-7-5 22:14:09 |
|
爱琴海校区-胡靖欢 (胡靖欢1)
|
9ms |
384 KiB |
|
326 Bytes |
2023-4-8 10:06:34 |
|
chaikexu
|
9ms |
512 KiB |
|
252 Bytes |
2022-9-11 9:14:23 |
|
kim
|
9ms |
384 KiB |
|
293 Bytes |
2023-3-3 20:47:05 |
|
郭人瑀作业号
|
9ms |
512 KiB |
|
333 Bytes |
2022-8-2 15:33:39 |
|
手搓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 |
384 KiB |
|
349 Bytes |
2023-5-20 13:09:08 |
|
kim
|
9ms |
384 KiB |
|
293 Bytes |
2023-3-3 20:47:02 |
|
爱情海校区—沙天一 (沙天一)
|
9ms |
384 KiB |
|
272 Bytes |
2023-4-8 10:06:09 |
|
王义苇 (wangyiwei)
|
9ms |
384 KiB |
|
324 Bytes |
2023-2-12 15:32:38 |
|
李晨希
|
9ms |
384 KiB |
|
284 Bytes |
2023-4-8 10:03:33 |
|
时代二校-陈天成 (鸭缩毛巾)
|
9ms |
384 KiB |
|
366 Bytes |
2023-5-22 21:07:28 |
|
kim
|
9ms |
408 KiB |
|
293 Bytes |
2023-3-3 20:47:06 |
|
赵泳鑫 (zhaoyongxin)
|
9ms |
384 KiB |
|
267 Bytes |
2022-5-14 18:09:08 |
|
胡澜之 (666hlz666)
|
9ms |
384 KiB |
|
309 Bytes |
2023-5-25 18:30:13 |
|
拥抱幸福小熊(吴沛篪)
|
9ms |
7.1 MiB |
C++98 |
292 Bytes |
2024-4-25 16:14:20 |
|
🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕 (bro)
|
9ms |
384 KiB |
|
463 Bytes |
2022-1-27 20:48:53 |
|
杜俊宏
|
9ms |
452 KiB |
|
302 Bytes |
2022-6-12 11:38:50 |
|
陈风亦 (chenfengyi)
|
9ms |
384 KiB |
|
244 Bytes |
2022-6-18 15:15:45 |
|
bvvd
|
9ms |
7 MiB |
C++98 |
266 Bytes |
2024-6-9 15:09:58 |
|
冒牌陈杰晟【MOD】 (wed)
|
9ms |
384 KiB |
|
211 Bytes |
2022-3-3 19:34:14 |
|
LUKHE (LukeHu)
|
9ms |
512 KiB |
|
277 Bytes |
2022-2-20 13:45:10 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
9ms |
392 KiB |
|
341 Bytes |
2022-8-31 14:29:03 |
|
胡宸华 (huchenhua)
|
9ms |
6.9 MiB |
|
346 Bytes |
2023-8-20 22:13:12 |
|
雷文博(帅哥) (18983951391)
|
9ms |
384 KiB |
|
257 Bytes |
2023-2-16 19:52:34 |
|
wangzihang
|
9ms |
7 MiB |
C++98 |
471 Bytes |
2024-6-8 21:18:45 |
|
雷文博(帅哥) (18983951391)
|
9ms |
384 KiB |
|
257 Bytes |
2023-2-12 15:42:25 |
|
huyinuo
|
9ms |
432 KiB |
|
567 Bytes |
2022-6-8 17:48:46 |
|
陈于硕(我™的) (chenyu)
|
9ms |
384 KiB |
|
329 Bytes |
2023-4-8 9:51:32 |
|
新壹街校区-郭老师-陈品烨 (陈品烨)
|
9ms |
6.8 MiB |
|
274 Bytes |
2023-10-3 17:07:37 |
|
tsc_ (杨悦堃)
|
9ms |
512 KiB |
|
446 Bytes |
2023-5-13 20:06:28 |
|
经常消失 (小萝卜)
|
9ms |
392 KiB |
|
281 Bytes |
2022-4-30 13:22:29 |
|
曹埊睿 (caodirui)
|
9ms |
440 KiB |
|
239 Bytes |
2023-4-21 20:10:43 |
|
文硕 (文硕1)
|
9ms |
512 KiB |
|
267 Bytes |
2022-7-12 11:54:14 |
|
xmw318046
|
10ms |
6.4 MiB |
C++98 |
307 Bytes |
2024-7-6 13:52:11 |
|
ycy
|
10ms |
384 KiB |
|
250 Bytes |
2022-4-21 9:37:27 |
|
钟京润
|
10ms |
392 KiB |
|
282 Bytes |
2022-6-18 15:20:34 |
|
kim
|
10ms |
384 KiB |
|
293 Bytes |
2023-3-3 20:46:59 |
|
黄彦熹 (AK-203)
|
10ms |
428 KiB |
|
370 Bytes |
2023-2-26 19:46:37 |
|
蒲梓勋 (puzixun)
|
10ms |
416 KiB |
|
254 Bytes |
2022-9-4 11:41:30 |
|
maobohan
|
10ms |
384 KiB |
|
272 Bytes |
2023-4-29 11:51:18 |
|
周琪渃
|
10ms |
384 KiB |
|
416 Bytes |
2023-2-13 21:32:26 |
|
yuhaodi
|
10ms |
512 KiB |
|
302 Bytes |
2023-4-23 17:21:14 |
|
芒苒忧 (廖迦南)
|
10ms |
444 KiB |
|
232 Bytes |
2022-8-15 14:56:03 |
|
黄梓轩 (huangzixuan)
|
10ms |
392 KiB |
|
264 Bytes |
2023-5-28 14:44:43 |
|
谭懿轩 (yanyixuan)
|
10ms |
392 KiB |
|
223 Bytes |
2022-2-19 10:20:57 |
|
中岛敦 (黄麒瑞)
|
10ms |
6.8 MiB |
|
358 Bytes |
2023-10-3 15:14:29 |
|
阮 (媚狐不吃道旁李)
|
10ms |
7.2 MiB |
C++98 |
337 Bytes |
2024-5-2 16:37:43 |
|
无尽的想象 (谭仕高)
|
10ms |
400 KiB |
|
317 Bytes |
2023-3-7 21:17:40 |
|
时代二校-焦雨齐 (Angel)
|
10ms |
384 KiB |
|
251 Bytes |
2023-5-27 16:02:27 |
|
何欣洋
|
10ms |
384 KiB |
|
284 Bytes |
2023-4-8 10:03:53 |
|
yanxiaosong
|
10ms |
492 KiB |
|
326 Bytes |
2022-9-12 10:25:19 |
|
pandap&a王皓宸 (WANGHAOCHEN)
|
10ms |
392 KiB |
|
629 Bytes |
2023-4-29 16:24:33 |
|
lch (凌昌瀚)
|
10ms |
440 KiB |
|
312 Bytes |
2022-7-5 18:40:48 |
|
luoluonuoya
|
10ms |
392 KiB |
|
378 Bytes |
2022-3-20 14:40:35 |
|
杨坤霖 (steven)
|
10ms |
400 KiB |
|
311 Bytes |
2023-2-3 11:20:26 |
|
(金沙天街)严皓月 (严皓月)
|
10ms |
6.8 MiB |
|
274 Bytes |
2023-9-29 11:51:50 |
|
疯神芭芭脱丝 (李卓修)
|
10ms |
384 KiB |
|
315 Bytes |
2022-1-24 18:01:29 |
|
李书翰 (lishuhan)
|
10ms |
440 KiB |
|
254 Bytes |
2022-4-9 19:26:42 |
|
AC[谭赫奕] (tanheyi)
|
10ms |
384 KiB |
|
315 Bytes |
2023-4-16 11:39:03 |
|
xiongxinyao
|
10ms |
384 KiB |
|
362 Bytes |
2022-11-4 19:57:45 |
|
源著校区-宋昊成 (马冬梅)
|
10ms |
440 KiB |
|
387 Bytes |
2023-2-26 19:38:26 |
|
詹宇航 (zyh7)
|
10ms |
384 KiB |
|
291 Bytes |
2022-7-8 18:13:20 |
|
新壹街校区-陈琬舒 (空空大师)
|
10ms |
6.7 MiB |
|
247 Bytes |
2023-9-9 11:45:26 |
|
雷文博(帅哥) (18983951391)
|
10ms |
384 KiB |
|
257 Bytes |
2023-2-16 19:51:23 |
|
pandap&a王皓宸 (WANGHAOCHEN)
|
10ms |
512 KiB |
|
618 Bytes |
2023-4-30 9:05:06 |
|
肖添宇
|
10ms |
424 KiB |
|
392 Bytes |
2022-5-14 16:59:18 |
|
李哲 (lizhe)
|
10ms |
392 KiB |
|
434 Bytes |
2022-11-15 22:27:26 |
|
金沙校区-先珂熠 (九转大肠)
|
10ms |
6.9 MiB |
C++20(O2) |
362 Bytes |
2024-8-17 20:11:53 |
|
zyq1
|
10ms |
384 KiB |
|
354 Bytes |
2023-5-29 20:05:15 |
|
许梓宸 (xuzichen)
|
10ms |
6.7 MiB |
C++17(O2) |
349 Bytes |
2024-7-17 16:39:49 |
|
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)
|
10ms |
6.9 MiB |
|
419 Bytes |
2023-8-17 15:09:02 |
|
我推的乱破 (贺俊楠)
|
10ms |
428 KiB |
|
370 Bytes |
2023-4-9 9:13:39 |
|
胡程禹
|
10ms |
6.7 MiB |
|
325 Bytes |
2023-9-13 20:46:27 |
|
孙烽轶 (sfy)
|
10ms |
6.8 MiB |
C++98 |
246 Bytes |
2024-8-12 16:43:33 |
|
陈杰晟
|
10ms |
440 KiB |
|
263 Bytes |
2022-4-30 13:17:36 |
|
zhm123
|
10ms |
436 KiB |
|
236 Bytes |
2022-10-28 17:55:36 |
|
李卓燃 (李卓燃1)
|
10ms |
512 KiB |
|
251 Bytes |
2023-3-3 20:41:48 |
|
zvt_132 (任子轩)
|
10ms |
6.7 MiB |
|
269 Bytes |
2023-8-30 11:38:39 |
|
huanglu
|
10ms |
440 KiB |
|
398 Bytes |
2022-11-4 16:52:08 |
|
何星震 (Jacob)
|
10ms |
440 KiB |
|
255 Bytes |
2022-11-17 12:26:55 |