|
chen (peter)
|
13ms |
256 KiB |
|
245 Bytes |
2022-6-5 17:24:04 |
|
Eric Zoe (05c35-zyr)
|
14ms |
320 KiB |
|
351 Bytes |
2022-9-11 11:58:29 |
|
1396013295
|
14ms |
316 KiB |
|
322 Bytes |
2022-1-22 17:32:23 |
|
Eric Zoe (05c35-zyr)
|
15ms |
384 KiB |
|
333 Bytes |
2022-9-11 11:58:10 |
|
胡宸华 (huchenhua)
|
16ms |
384 KiB |
|
325 Bytes |
2022-11-12 22:34:14 |
|
何昊宇 (22016-hhy)
|
23ms |
7.1 MiB |
|
242 Bytes |
2024-1-17 18:45:43 |
|
U城校区-漆子轩 (叶子小七)
|
24ms |
7 MiB |
C++11 |
240 Bytes |
2024-6-13 19:52:18 |
|
Iodef (OP AI)
|
24ms |
7 MiB |
C++11 |
269 Bytes |
2024-6-28 22:19:48 |
|
NJL (NJlL)
|
24ms |
512 KiB |
|
234 Bytes |
2022-6-26 16:28:04 |
|
李彦臻
|
24ms |
6.7 MiB |
C++98 |
259 Bytes |
2024-6-28 20:04:07 |
|
杜俊宏
|
25ms |
392 KiB |
|
223 Bytes |
2022-5-15 17:08:07 |
|
maomao
|
25ms |
384 KiB |
|
202 Bytes |
2022-5-25 17:59:12 |
|
谢延灏 (xeiyanhao---a handsome boy)
|
25ms |
392 KiB |
|
223 Bytes |
2022-3-4 18:29:24 |
|
李山水
|
25ms |
384 KiB |
|
310 Bytes |
2022-3-29 20:24:50 |
|
zyz (曾韵竹)
|
25ms |
7 MiB |
C++98 |
234 Bytes |
2024-6-13 19:50:30 |
|
颐和园呵呵一盒一盒一盒你呢他已经儿童节 (高晨曦)
|
25ms |
7 MiB |
C++98 |
245 Bytes |
2024-6-13 19:47:44 |
|
王韵淮
|
25ms |
384 KiB |
|
206 Bytes |
2022-5-17 20:49:57 |
|
Accepted (周芷乐)
|
25ms |
6.9 MiB |
C++14 |
213 Bytes |
2024-8-17 15:16:41 |
|
不怎么聪明的家伙 (贺俊楠)
|
25ms |
7 MiB |
C++98(O2) |
243 Bytes |
2024-5-5 11:48:48 |
|
zlx (xiao)
|
25ms |
424 KiB |
|
321 Bytes |
2022-5-25 19:54:03 |
|
许徐非凡 (非同凡响)
|
25ms |
7 MiB |
C++98 |
276 Bytes |
2024-6-13 19:52:00 |
|
Sivan
|
25ms |
6.6 MiB |
C++98(O2) |
246 Bytes |
2024-7-13 17:21:31 |
|
新壹街校区-陈琬舒 (空空大师)
|
26ms |
6.9 MiB |
C++98 |
220 Bytes |
2024-5-6 21:38:10 |
|
王晨志 (wangchenzhi)
|
26ms |
512 KiB |
|
284 Bytes |
2022-5-28 22:47:17 |
|
游智棋
|
26ms |
7 MiB |
C++17 |
217 Bytes |
2024-6-15 19:36:05 |
|
11111
|
26ms |
384 KiB |
|
223 Bytes |
2022-6-5 18:36:33 |
|
樊竣熠 (lft1114)
|
26ms |
412 KiB |
|
212 Bytes |
2022-8-16 9:54:02 |
|
lch (凌昌瀚)
|
26ms |
404 KiB |
|
239 Bytes |
2022-7-7 22:24:34 |
|
疯神芭芭脱丝 (李卓修)
|
26ms |
392 KiB |
|
324 Bytes |
2022-6-9 19:40:37 |
|
姚宏逸
|
26ms |
400 KiB |
|
274 Bytes |
2022-2-4 11:59:11 |
|
余瀚
|
26ms |
7 MiB |
C++11 |
245 Bytes |
2024-8-22 17:53:03 |
|
MoonLight ( aaa)
|
26ms |
428 KiB |
|
311 Bytes |
2022-1-8 9:46:35 |
|
任瑞 的 学生 (jiangyadong)
|
26ms |
384 KiB |
|
246 Bytes |
2022-6-19 12:45:51 |
|
不跟XXS(黄立信)一般见识 (吕同学)
|
26ms |
6.6 MiB |
C++14(O2) |
475 Bytes |
2024-7-6 15:07:55 |
|
张瑞博
|
26ms |
6.8 MiB |
C++11 |
216 Bytes |
2024-5-25 20:04:12 |
|
贾博涵
|
26ms |
6.9 MiB |
|
313 Bytes |
2023-11-10 12:05:22 |
|
ywh
|
26ms |
384 KiB |
|
243 Bytes |
2022-6-19 9:03:46 |
|
(05c35-cyd)
|
27ms |
512 KiB |
|
262 Bytes |
2022-2-27 12:55:09 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
27ms |
392 KiB |
|
280 Bytes |
2022-6-29 17:30:01 |
|
xiangsiyu
|
27ms |
512 KiB |
|
255 Bytes |
2022-7-12 10:20:05 |
|
wangzihang
|
27ms |
440 KiB |
C++ |
169 Bytes |
2022-8-2 9:05:15 |
|
詹宇航 (zyh7)
|
27ms |
384 KiB |
|
202 Bytes |
2022-7-8 18:02:33 |
|
朱老师 (zyp)
|
27ms |
436 KiB |
|
233 Bytes |
2022-8-6 11:13:27 |
|
Zongzi1
|
27ms |
6.7 MiB |
C++17(O2) |
281 Bytes |
2024-7-17 23:47:30 |
|
曹埊睿 (caodirui)
|
27ms |
384 KiB |
|
272 Bytes |
2023-5-2 23:09:26 |
|
heyi
|
27ms |
6.8 MiB |
C++98(O2) |
265 Bytes |
2024-8-10 13:46:31 |
|
张月恒
|
27ms |
6.8 MiB |
C++98(O2) |
238 Bytes |
2024-8-25 15:01:49 |
|
cheers 戴 (daizhuorun)
|
27ms |
384 KiB |
|
260 Bytes |
2022-4-9 15:55:24 |
|
黄梓桐 (HuangZiTong)
|
27ms |
512 KiB |
|
243 Bytes |
2022-7-15 17:41:20 |
|
MoonLight ( aaa)
|
27ms |
440 KiB |
|
311 Bytes |
2022-2-19 9:43:31 |
|
汪致卉 (wangzh)
|
27ms |
384 KiB |
|
266 Bytes |
2022-1-22 19:47:01 |
|
konglinghao(算法战神) (konglinghao)
|
27ms |
7 MiB |
C++98 |
224 Bytes |
2024-5-19 16:41:40 |
|
ddz
|
27ms |
512 KiB |
|
309 Bytes |
2022-3-20 18:19:25 |
|
赵泳鑫 (zhaoyongxin)
|
27ms |
436 KiB |
|
423 Bytes |
2022-6-9 19:18:03 |
|
Erin
|
27ms |
7 MiB |
C++98 |
220 Bytes |
2024-5-4 19:10:28 |
|
05c35-wyf
|
27ms |
512 KiB |
|
253 Bytes |
2022-2-20 12:49:40 |
|
况奕辛 (KYX_yyds)
|
27ms |
384 KiB |
|
219 Bytes |
2022-3-4 17:29:38 |
|
杜是贤 (dushixian)
|
27ms |
512 KiB |
|
293 Bytes |
2022-4-17 11:21:12 |
|
李山水
|
28ms |
412 KiB |
|
310 Bytes |
2022-3-29 20:24:50 |
|
李艾芯 (starry sky)
|
28ms |
444 KiB |
|
297 Bytes |
2022-7-10 11:09:51 |
|
zhangyh (张育菡)
|
28ms |
512 KiB |
|
285 Bytes |
2022-6-10 22:29:10 |
|
谭懿轩 (yanyixuan)
|
28ms |
436 KiB |
|
225 Bytes |
2022-2-15 18:07:03 |
|
新壹街陈科言 (cky)
|
28ms |
7 MiB |
C++98 |
248 Bytes |
2024-8-25 11:07:53 |
|
文硕 (文硕1)
|
28ms |
512 KiB |
|
440 Bytes |
2022-7-12 11:33:59 |
|
李树崑 (lishukun)
|
28ms |
528 KiB |
|
290 Bytes |
2022-6-26 12:07:57 |
|
huyinuo
|
28ms |
440 KiB |
|
273 Bytes |
2022-3-10 20:00:40 |
|
肖添宇
|
28ms |
432 KiB |
|
274 Bytes |
2022-3-26 17:56:13 |
|
洛阳 锦程 (郭思利)
|
28ms |
7 MiB |
C++98 |
228 Bytes |
2024-5-26 10:45:49 |
|
Cristiano·Ronaldo (05c41-gmz)
|
28ms |
436 KiB |
|
233 Bytes |
2022-7-27 13:43:47 |
|
qwerty
|
28ms |
444 KiB |
|
257 Bytes |
2022-3-11 19:50:04 |
|
leisixian (22029-lyh)
|
28ms |
384 KiB |
|
275 Bytes |
2022-12-3 10:25:28 |
|
曾龙兮
|
28ms |
428 KiB |
|
249 Bytes |
2023-3-12 18:55:11 |
|
魑归sama
|
28ms |
512 KiB |
|
202 Bytes |
2022-7-12 16:23:47 |
|
罗晨睿 (luochenrui)
|
28ms |
440 KiB |
|
248 Bytes |
2022-6-29 13:24:49 |
|
时代2校-程俊燃 (chengjunran)
|
28ms |
6.8 MiB |
|
300 Bytes |
2023-10-24 19:50:33 |
|
伍行念 (wuxingnian)
|
28ms |
6.7 MiB |
|
324 Bytes |
2023-9-25 11:59:55 |
|
xxteacher
|
28ms |
512 KiB |
|
362 Bytes |
2022-2-15 15:18:36 |
|
廖海宇在追杀马牌痞 (liaohaiyu22031)
|
28ms |
428 KiB |
|
266 Bytes |
2023-5-10 22:25:53 |
|
火爆肥肠(杨弘毅) (火爆肥肠)
|
28ms |
512 KiB |
|
284 Bytes |
2022-3-17 21:20:55 |
|
马渝杭 (mayuhang)
|
28ms |
512 KiB |
|
229 Bytes |
2022-8-10 18:18:49 |
|
吴俊成 (wujuncheng)
|
28ms |
512 KiB |
|
256 Bytes |
2022-7-10 10:27:35 |
|
17779
|
28ms |
512 KiB |
|
245 Bytes |
2022-3-9 16:57:19 |
|
王乐仪
|
28ms |
440 KiB |
|
242 Bytes |
2022-2-17 20:30:51 |
|
陈杰晟
|
28ms |
440 KiB |
|
306 Bytes |
2022-3-1 18:38:07 |
|
luoluonuoya
|
28ms |
512 KiB |
|
253 Bytes |
2022-4-9 15:47:18 |
|
dmh (丁墨涵)
|
28ms |
512 KiB |
|
251 Bytes |
2022-3-6 10:28:05 |
|
xiongxinyao
|
28ms |
384 KiB |
|
345 Bytes |
2022-11-4 19:12:31 |
|
Ronnie
|
28ms |
512 KiB |
|
297 Bytes |
2022-2-19 22:21:45 |
|
wuzhenghan
|
29ms |
384 KiB |
|
275 Bytes |
2022-11-5 20:22:45 |
|
时代一校 - 冯隆浩 (冯隆浩)
|
29ms |
508 KiB |
|
237 Bytes |
2022-8-15 23:38:48 |
|
张祖名
|
29ms |
7 MiB |
C++98(O2) |
236 Bytes |
2024-6-9 11:23:53 |
|
wangruibo20xh
|
29ms |
512 KiB |
|
169 Bytes |
2022-2-11 14:22:22 |
|
22029-zjs
|
29ms |
412 KiB |
|
268 Bytes |
2022-12-3 10:46:05 |
|
周浩楠 (开朗的周好难)
|
29ms |
6.7 MiB |
|
257 Bytes |
2023-8-31 15:20:18 |
|
林小博
|
29ms |
512 KiB |
|
287 Bytes |
2022-7-1 10:41:47 |
|
zcx
|
29ms |
392 KiB |
|
285 Bytes |
2022-12-3 10:39:15 |
|
11451254188 (22029-mjh)
|
29ms |
392 KiB |
|
279 Bytes |
2022-12-3 10:38:54 |
|
手搓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)
|
29ms |
384 KiB |
|
304 Bytes |
2022-12-3 11:12:59 |
|
凌肯 (lingken22006)
|
29ms |
512 KiB |
|
297 Bytes |
2022-7-31 21:55:27 |
|
没有此人 (akm)
|
29ms |
7.2 MiB |
C++14 |
272 Bytes |
2024-4-21 22:22:07 |