|
zyl
|
4ms |
7.3 MiB |
|
430 Bytes |
2024-1-4 9:44:59 |
|
文硕 (文硕1)
|
6ms |
256 KiB |
|
312 Bytes |
2023-2-1 8:35:18 |
|
德克萨斯做的到吗 (liyangbao)
|
6ms |
256 KiB |
|
218 Bytes |
2022-11-14 19:37:21 |
|
疯神芭芭脱丝 (李卓修)
|
6ms |
256 KiB |
|
193 Bytes |
2022-7-14 15:34:53 |
|
姚宏逸
|
6ms |
256 KiB |
|
233 Bytes |
2022-2-16 18:42:38 |
|
朱泽晟
|
7ms |
332 KiB |
|
240 Bytes |
2022-2-13 11:23:14 |
|
樊竣熠 (lft1114)
|
7ms |
312 KiB |
|
275 Bytes |
2022-8-16 9:54:38 |
|
李彭 宋代诗人 (ljy123456)
|
8ms |
316 KiB |
|
292 Bytes |
2023-3-23 6:54:21 |
|
chen (peter)
|
9ms |
320 KiB |
|
335 Bytes |
2022-11-12 18:51:59 |
|
杨坤霖 (steven)
|
9ms |
256 KiB |
|
258 Bytes |
2022-11-19 10:21:13 |
|
Turorany (郑浩然)
|
12ms |
6.9 MiB |
|
294 Bytes |
2023-12-1 19:36:22 |
|
吴俊成 (wujuncheng)
|
12ms |
384 KiB |
|
256 Bytes |
2022-7-10 10:02:18 |
|
zlx (xiao)
|
12ms |
384 KiB |
|
300 Bytes |
2022-5-25 19:52:14 |
|
lch (凌昌瀚)
|
12ms |
512 KiB |
|
250 Bytes |
2022-7-7 22:13:37 |
|
tcx
|
12ms |
384 KiB |
|
252 Bytes |
2023-2-26 10:24:14 |
|
龙湖时代C馆-邹镇宇 (邹镇宇)
|
12ms |
384 KiB |
|
252 Bytes |
2023-5-9 21:40:34 |
|
郭睿
|
12ms |
6.8 MiB |
|
226 Bytes |
2023-11-17 22:14:01 |
|
明轩 (吕同学)
|
12ms |
6.7 MiB |
C++14(O2) |
444 Bytes |
2024-7-17 8:42:06 |
|
huyinuo
|
12ms |
384 KiB |
|
239 Bytes |
2022-2-26 19:36:04 |
|
§范马 · 猫羽雫™☠ (lixiaoxiang22031)
|
13ms |
392 KiB |
|
250 Bytes |
2023-2-26 10:05:03 |
|
偽艺術家 (chenyanchi22006)
|
13ms |
384 KiB |
|
298 Bytes |
2022-6-23 22:04:10 |
|
李树崑 (lishukun)
|
13ms |
384 KiB |
|
554 Bytes |
2022-4-16 15:16:47 |
|
Yuan (Zongzi1)
|
13ms |
6.7 MiB |
C++17(O2) |
262 Bytes |
2024-7-17 23:22:35 |
|
303
|
13ms |
384 KiB |
|
301 Bytes |
2022-5-29 10:10:19 |
|
§范马 · 猫羽雫™☠ (lixiaoxiang22031)
|
13ms |
384 KiB |
|
250 Bytes |
2023-2-26 10:04:52 |
|
§范马 · 猫羽雫™☠ (lixiaoxiang22031)
|
13ms |
384 KiB |
|
250 Bytes |
2023-2-26 10:05:04 |
|
马渝杭 (mayuhang)
|
13ms |
512 KiB |
|
254 Bytes |
2023-4-10 10:31:16 |
|
MoonLight ( aaa)
|
13ms |
384 KiB |
|
470 Bytes |
2022-1-3 17:55:04 |
|
17779
|
13ms |
384 KiB |
|
248 Bytes |
2022-3-10 10:39:58 |
|
xiangsiyu
|
13ms |
384 KiB |
|
236 Bytes |
2022-7-12 10:17:44 |
|
任瑞 的 学生 (jiangyadong)
|
13ms |
512 KiB |
|
234 Bytes |
2022-6-19 11:30:47 |
|
luoluonuoya
|
13ms |
384 KiB |
|
348 Bytes |
2022-2-7 15:59:23 |
|
刘沐僖太逊了 (lmxasgy1314)
|
13ms |
384 KiB |
|
229 Bytes |
2022-5-29 9:59:19 |
|
汪致卉 (wangzh)
|
13ms |
384 KiB |
|
242 Bytes |
2022-1-24 20:59:04 |
|
肖添宇
|
13ms |
384 KiB |
|
8.9 KiB |
2022-4-16 17:50:20 |
|
廖海宇在追杀马牌痞 (liaohaiyu22031)
|
13ms |
384 KiB |
|
300 Bytes |
2023-2-26 9:46:58 |
|
§范马 · 猫羽雫™☠ (lixiaoxiang22031)
|
13ms |
384 KiB |
|
250 Bytes |
2023-2-26 10:05:18 |
|
TBB (杜昊燃)
|
13ms |
384 KiB |
|
277 Bytes |
2022-5-1 22:43:04 |
|
chenrunxiang22031
|
13ms |
384 KiB |
|
222 Bytes |
2023-2-26 10:01:58 |
|
qinyi
|
13ms |
384 KiB |
|
283 Bytes |
2022-3-5 16:14:04 |
|
tcx
|
13ms |
388 KiB |
|
252 Bytes |
2023-2-26 10:02:14 |
|
王韵淮
|
13ms |
512 KiB |
|
209 Bytes |
2022-6-6 21:28:44 |
|
罗晨睿 (luochenrui)
|
13ms |
436 KiB |
|
233 Bytes |
2022-6-29 13:23:12 |
|
tcx
|
13ms |
384 KiB |
|
252 Bytes |
2023-2-26 10:04:42 |
|
王晨志 (wangchenzhi)
|
13ms |
384 KiB |
|
270 Bytes |
2022-5-28 22:44:48 |
|
§范马 · 猫羽雫™☠ (lixiaoxiang22031)
|
13ms |
384 KiB |
|
250 Bytes |
2023-2-26 10:05:08 |
|
我很6 (zjj22031)
|
13ms |
384 KiB |
|
250 Bytes |
2023-2-26 9:56:20 |
|
黄梓桐 (HuangZiTong)
|
13ms |
384 KiB |
|
234 Bytes |
2022-7-15 17:14:32 |
|
曹埊睿 (caodirui)
|
13ms |
436 KiB |
|
238 Bytes |
2023-5-2 22:53:53 |
|
谭懿轩 (yanyixuan)
|
13ms |
512 KiB |
|
228 Bytes |
2022-2-15 17:31:49 |
|
无尽的想象 (谭仕高)
|
13ms |
384 KiB |
|
240 Bytes |
2022-7-27 16:55:12 |
|
经常消失 (小萝卜)
|
13ms |
384 KiB |
|
283 Bytes |
2022-4-17 18:49:55 |
|
qwerty
|
13ms |
384 KiB |
|
253 Bytes |
2022-3-10 14:37:38 |
|
陈杰晟
|
13ms |
428 KiB |
|
303 Bytes |
2022-2-23 14:44:15 |
|
22029-lyh
|
13ms |
400 KiB |
|
275 Bytes |
2023-2-26 9:51:00 |
|
Accepted (周芷乐)
|
13ms |
6.9 MiB |
C++14 |
370 Bytes |
2024-8-17 15:13:29 |
|
§范马 · 猫羽雫™☠ (lixiaoxiang22031)
|
13ms |
416 KiB |
|
250 Bytes |
2023-2-26 10:05:10 |
|
唐臣谦 (tangchenqian1)
|
13ms |
384 KiB |
|
223 Bytes |
2022-11-24 20:34:35 |
|
ywh
|
14ms |
512 KiB |
|
276 Bytes |
2022-6-28 19:59:49 |
|
朱老师 (zyp)
|
14ms |
384 KiB |
|
466 Bytes |
2023-2-26 9:50:31 |
|
tcx
|
14ms |
384 KiB |
|
252 Bytes |
2023-2-26 10:01:21 |
|
蒲梓勋 (puzixun)
|
14ms |
392 KiB |
|
265 Bytes |
2022-11-27 10:02:22 |
|
陈博昊 (cbh)
|
14ms |
6.8 MiB |
|
224 Bytes |
2023-11-1 20:25:11 |
|
zjm
|
14ms |
384 KiB |
|
226 Bytes |
2023-2-26 9:55:52 |
|
王乐仪
|
14ms |
436 KiB |
|
251 Bytes |
2022-2-4 17:31:17 |
|
§范马 · 猫羽雫™☠ (lixiaoxiang22031)
|
14ms |
384 KiB |
|
250 Bytes |
2023-2-26 10:12:44 |
|
黄梓桐 (HuangZiTong)
|
14ms |
512 KiB |
|
234 Bytes |
2022-7-15 17:14:26 |
|
hyh22031
|
14ms |
392 KiB |
|
245 Bytes |
2023-2-26 10:01:10 |
|
tcx
|
14ms |
384 KiB |
|
252 Bytes |
2023-2-26 10:02:14 |
|
heyi
|
14ms |
6.8 MiB |
C++98(O2) |
387 Bytes |
2024-8-9 11:47:03 |
|
杜是贤 (dushixian)
|
14ms |
440 KiB |
|
242 Bytes |
2022-7-17 14:53:25 |
|
maomao
|
14ms |
436 KiB |
|
222 Bytes |
2022-5-25 17:30:32 |
|
(张洛诚)
|
14ms |
384 KiB |
|
333 Bytes |
2023-5-9 21:16:04 |
|
huanglu
|
14ms |
6.9 MiB |
|
301 Bytes |
2023-7-15 16:44:31 |
|
LittleHair
|
14ms |
6.8 MiB |
C++11 |
277 Bytes |
2024-8-10 18:36:34 |
|
朱老师 (zyp)
|
14ms |
444 KiB |
|
246 Bytes |
2022-8-6 11:02:08 |
|
§范马 · 猫羽雫™☠ (lixiaoxiang22031)
|
14ms |
392 KiB |
|
250 Bytes |
2023-2-26 10:05:19 |
|
tcx
|
14ms |
384 KiB |
|
252 Bytes |
2023-2-26 10:02:11 |
|
周琪渃
|
14ms |
384 KiB |
|
267 Bytes |
2023-3-19 21:14:56 |
|
手搓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)
|
14ms |
384 KiB |
|
319 Bytes |
2023-5-26 19:31:39 |
|
yang
|
14ms |
440 KiB |
|
303 Bytes |
2022-9-8 13:10:14 |
|
况奕辛 (KYX_yyds)
|
14ms |
512 KiB |
|
305 Bytes |
2022-3-8 20:40:56 |
|
叶哲宇 (yzy)
|
14ms |
6.8 MiB |
|
230 Bytes |
2023-8-24 17:28:33 |
|
§范马 · 猫羽雫™☠ (lixiaoxiang22031)
|
14ms |
392 KiB |
|
250 Bytes |
2023-2-26 10:05:02 |
|
tcx
|
14ms |
392 KiB |
|
252 Bytes |
2023-2-26 10:02:14 |
|
李卓燃 (李卓燃1)
|
14ms |
436 KiB |
|
272 Bytes |
2023-4-14 18:00:34 |
|
杨宇航1
|
14ms |
500 KiB |
|
250 Bytes |
2023-4-1 18:38:00 |
|
wangruibo20xh
|
14ms |
512 KiB |
|
211 Bytes |
2022-2-11 14:21:01 |
|
Nico
|
14ms |
436 KiB |
|
234 Bytes |
2023-5-20 14:17:40 |
|
yuandingyang22031
|
14ms |
384 KiB |
|
211 Bytes |
2023-2-26 10:03:23 |
|
呵呵呵 (陈思琦)
|
14ms |
440 KiB |
|
217 Bytes |
2022-12-31 16:35:28 |
|
李哲 (lizhe)
|
14ms |
432 KiB |
|
268 Bytes |
2022-8-18 22:32:23 |
|
SYC0226
|
15ms |
428 KiB |
|
260 Bytes |
2022-3-20 11:37:29 |
|
邵冠铖 (shaoguancheng22031)
|
15ms |
384 KiB |
|
242 Bytes |
2023-2-26 9:53:10 |
|
黄立信
|
15ms |
6.8 MiB |
|
376 Bytes |
2023-10-14 13:32:48 |
|
zzl
|
15ms |
6.8 MiB |
|
251 Bytes |
2023-11-7 0:36:06 |
|
§范马 · 猫羽雫™☠ (lixiaoxiang22031)
|
15ms |
392 KiB |
|
250 Bytes |
2023-2-26 10:05:02 |
|
孙烽轶 (sfy)
|
15ms |
6.9 MiB |
|
244 Bytes |
2023-8-7 13:19:13 |
|
胡澜之 (666hlz666)
|
15ms |
6.9 MiB |
|
214 Bytes |
2023-7-9 10:22:22 |
|
胡宸华 (huchenhua)
|
15ms |
440 KiB |
|
336 Bytes |
2022-11-7 8:36:42 |