|
qwerty
|
6ms |
384 KiB |
C |
211 Bytes |
2022-3-6 1:32:20 |
|
李树崑 (lishukun)
|
7ms |
392 KiB |
|
407 Bytes |
2022-4-27 18:32:54 |
|
wangzihang
|
7ms |
316 KiB |
C++ |
265 Bytes |
2022-7-31 10:14:27 |
|
时代一校-曾科智 (曾科智)
|
7ms |
300 KiB |
|
565 Bytes |
2023-3-4 18:31:59 |
|
陈雨泽1
|
7ms |
308 KiB |
|
565 Bytes |
2023-2-18 11:15:49 |
|
杨坤霖 (steven)
|
7ms |
264 KiB |
|
301 Bytes |
2022-11-5 16:47:55 |
|
德克萨斯做的到吗 (liyangbao)
|
7ms |
256 KiB |
|
289 Bytes |
2022-11-13 23:22:21 |
|
wangruibo20xh
|
7ms |
316 KiB |
|
265 Bytes |
2022-2-11 14:16:39 |
|
胡宸华 (huchenhua)
|
8ms |
384 KiB |
|
180 Bytes |
2022-11-6 12:01:37 |
|
huanglu
|
12ms |
7.2 MiB |
|
234 Bytes |
2023-11-30 18:12:34 |
|
杜俊宏
|
12ms |
388 KiB |
|
220 Bytes |
2022-7-17 10:44:15 |
|
许律天
|
12ms |
7.2 MiB |
|
201 Bytes |
2023-11-30 20:31:16 |
|
任瑞 的 学生 (jiangyadong)
|
12ms |
384 KiB |
|
280 Bytes |
2022-6-16 13:43:34 |
|
cupy战士 (05c05-dkf)
|
12ms |
392 KiB |
|
211 Bytes |
2023-4-2 16:46:54 |
|
杜俊宏
|
12ms |
412 KiB |
|
243 Bytes |
2022-7-17 10:30:48 |
|
yang
|
12ms |
384 KiB |
|
258 Bytes |
2022-8-14 19:53:01 |
|
无尽的想象 (谭仕高)
|
12ms |
384 KiB |
|
214 Bytes |
2022-7-5 22:56:35 |
|
_PXY_
|
12ms |
384 KiB |
|
254 Bytes |
2022-1-25 14:35:08 |
|
Erin
|
12ms |
7.2 MiB |
C++98 |
252 Bytes |
2024-5-3 19:37:34 |
|
王晨志 (wangchenzhi)
|
12ms |
392 KiB |
|
575 Bytes |
2022-6-30 18:01:26 |
|
12345
|
12ms |
384 KiB |
|
413 Bytes |
2022-11-19 14:59:21 |
|
关博源
|
12ms |
384 KiB |
|
217 Bytes |
2023-4-1 11:19:59 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
13ms |
384 KiB |
|
320 Bytes |
2023-4-2 16:30:00 |
|
偽艺術家 (chenyanchi22006)
|
13ms |
384 KiB |
|
244 Bytes |
2022-8-20 14:39:43 |
|
stehpen_zuo
|
13ms |
7 MiB |
C++20 |
244 Bytes |
2024-5-29 19:39:08 |
|
Yuan (Zongzi1)
|
13ms |
6.7 MiB |
C++17(O2) |
276 Bytes |
2024-7-17 21:18:44 |
|
xiangsiyu
|
13ms |
384 KiB |
|
198 Bytes |
2022-7-12 9:58:24 |
|
Turorany (郑浩然)
|
13ms |
6.9 MiB |
C++98 |
305 Bytes |
2024-5-31 21:30:19 |
|
maomao
|
13ms |
436 KiB |
|
243 Bytes |
2022-5-23 22:51:04 |
|
无尽的想象 (谭仕高)
|
13ms |
384 KiB |
|
305 Bytes |
2022-7-5 22:51:29 |
|
05c05-zjk
|
13ms |
384 KiB |
|
232 Bytes |
2023-4-2 16:46:42 |
|
关博源
|
13ms |
392 KiB |
|
217 Bytes |
2023-4-1 11:20:02 |
|
汤杰尧 (05c05-tjy1)
|
13ms |
384 KiB |
|
186 Bytes |
2023-4-2 17:07:18 |
|
zlx (xiao)
|
13ms |
384 KiB |
|
372 Bytes |
2022-5-25 19:49:38 |
|
kql1
|
13ms |
7.1 MiB |
C++98 |
191 Bytes |
2024-5-9 13:54:39 |
|
https://www.minecraft.net/zh-hans (王振西)
|
13ms |
384 KiB |
|
694 Bytes |
2023-4-2 14:08:21 |
|
周琪渃
|
13ms |
384 KiB |
|
262 Bytes |
2023-3-5 11:41:45 |
|
scallway1
|
13ms |
384 KiB |
|
240 Bytes |
2022-7-18 12:01:55 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
13ms |
392 KiB |
|
299 Bytes |
2023-4-2 16:54:36 |
|
谢延灏 (xeiyanhao---a handsome boy)
|
13ms |
384 KiB |
|
284 Bytes |
2022-1-28 12:10:49 |
|
李哲 (lizhe)
|
13ms |
396 KiB |
|
201 Bytes |
2022-9-1 22:59:51 |
|
xxteacher
|
13ms |
384 KiB |
|
280 Bytes |
2022-3-29 14:51:42 |
|
邓皓文 (min_element)
|
13ms |
7.2 MiB |
C++11(O2) |
268 Bytes |
2024-5-2 17:57:34 |
|
1396013295
|
13ms |
384 KiB |
|
379 Bytes |
2022-1-24 18:18:45 |
|
叶梓珺
|
13ms |
7.1 MiB |
C++11 |
216 Bytes |
2024-5-26 11:36:53 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
13ms |
384 KiB |
|
227 Bytes |
2023-4-2 17:07:05 |
|
李禹衡 (liyuheng22006)
|
13ms |
388 KiB |
|
198 Bytes |
2023-4-2 16:36:15 |
|
tad (OP AI)
|
13ms |
6.9 MiB |
C++98 |
209 Bytes |
2024-6-24 23:16:11 |
|
文硕 (文硕1)
|
13ms |
384 KiB |
|
267 Bytes |
2022-2-6 13:51:48 |
|
吴俊成 (wujuncheng)
|
13ms |
436 KiB |
|
304 Bytes |
2022-7-9 22:24:25 |
|
龙湖时代C馆-邹镇宇 (邹镇宇)
|
13ms |
432 KiB |
|
219 Bytes |
2023-5-12 22:29:51 |
|
黄梓桐 (HuangZiTong)
|
13ms |
384 KiB |
|
217 Bytes |
2022-7-10 19:40:25 |
|
汤杰尧 (05c05-tjy1)
|
13ms |
384 KiB |
|
245 Bytes |
2023-4-2 16:38:13 |
|
longhao
|
13ms |
384 KiB |
|
247 Bytes |
2022-1-23 10:32:37 |
|
古煦涵
|
13ms |
6.9 MiB |
C++98 |
213 Bytes |
2024-8-18 13:50:00 |
|
郭人瑀作业号
|
13ms |
436 KiB |
|
242 Bytes |
2022-8-2 15:10:35 |
|
关博源
|
13ms |
384 KiB |
|
217 Bytes |
2023-4-1 11:19:59 |
|
廖海宇在追杀马牌痞 (liaohaiyu22031)
|
13ms |
7 MiB |
C++98 |
266 Bytes |
2024-5-19 15:11:12 |
|
赵泳鑫 (zhaoyongxin)
|
13ms |
440 KiB |
|
283 Bytes |
2022-4-23 17:52:47 |
|
源著校区-宋昊成 (马冬梅)
|
13ms |
400 KiB |
|
590 Bytes |
2023-4-8 18:07:57 |
|
Tender. (05c05-zhou)
|
13ms |
384 KiB |
|
339 Bytes |
2023-4-2 16:37:51 |
|
蔡蕊池
|
13ms |
7.2 MiB |
C++98 |
365 Bytes |
2024-4-30 20:28:42 |
|
黄立信
|
13ms |
6.8 MiB |
|
419 Bytes |
2023-10-14 12:50:38 |
|
赵奕铭
|
13ms |
7.1 MiB |
C++98 |
228 Bytes |
2024-5-9 13:28:27 |
|
况奕辛 (KYX_yyds)
|
13ms |
512 KiB |
|
164 Bytes |
2022-2-25 20:37:23 |
|
郑岐蔚
|
13ms |
412 KiB |
|
280 Bytes |
2023-4-12 19:56:05 |
|
爱琴海校区-黄辰浩 (huangchenhao)
|
13ms |
6.8 MiB |
|
265 Bytes |
2023-10-28 10:28:14 |
|
手搓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)
|
13ms |
384 KiB |
|
400 Bytes |
2022-11-26 11:18:59 |
|
zcx
|
13ms |
512 KiB |
|
309 Bytes |
2022-11-23 16:28:40 |
|
Tang
|
13ms |
512 KiB |
|
552 Bytes |
2022-4-23 15:05:48 |
|
关博源
|
13ms |
384 KiB |
|
217 Bytes |
2023-4-1 11:19:59 |
|
***
|
13ms |
384 KiB |
|
694 Bytes |
2023-3-2 15:28:03 |
|
时代2校-程俊燃 (chengjunran)
|
13ms |
6.9 MiB |
|
208 Bytes |
2023-8-20 22:47:45 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
13ms |
384 KiB |
|
227 Bytes |
2023-4-2 17:07:22 |
|
杜是贤 (dushixian)
|
13ms |
384 KiB |
|
378 Bytes |
2022-4-11 19:55:42 |
|
李彭 宋代诗人 (ljy123456)
|
13ms |
384 KiB |
|
302 Bytes |
2023-4-11 20:59:41 |
|
chen (peter)
|
13ms |
384 KiB |
|
359 Bytes |
2023-2-18 11:29:40 |
|
叶雨昊 (yeyuhao22006)
|
13ms |
384 KiB |
|
236 Bytes |
2023-4-2 16:30:53 |
|
x0l0x
|
14ms |
7 MiB |
|
221 Bytes |
2024-1-2 20:05:56 |
|
弹射起飞 ? 冲 ! (吴周周)
|
14ms |
6.8 MiB |
|
191 Bytes |
2023-10-14 17:10:56 |
|
周琪渃
|
14ms |
432 KiB |
|
300 Bytes |
2023-5-13 18:26:44 |
|
heyi
|
14ms |
6.8 MiB |
C++98(O2) |
213 Bytes |
2024-8-9 14:03:09 |
|
李山水
|
14ms |
384 KiB |
|
328 Bytes |
2022-9-15 19:00:39 |
|
在煎鱼的肖大总铳 (肖宇航)
|
14ms |
7.2 MiB |
C++11 |
216 Bytes |
2024-5-3 11:38:55 |
|
bilbil
|
14ms |
6.8 MiB |
|
243 Bytes |
2023-10-14 17:10:24 |
|
关博源
|
14ms |
440 KiB |
|
217 Bytes |
2023-4-1 11:19:59 |
|
关博源
|
14ms |
392 KiB |
|
217 Bytes |
2023-4-1 11:20:02 |
|
zjz
|
14ms |
384 KiB |
|
208 Bytes |
2022-1-25 10:35:38 |
|
scallway
|
14ms |
6.8 MiB |
|
293 Bytes |
2023-6-10 12:18:04 |
|
朱老师 (zyp)
|
14ms |
416 KiB |
|
293 Bytes |
2022-8-5 10:06:12 |
|
新壹街校区-陈琬舒 (空空大师)
|
14ms |
7 MiB |
|
195 Bytes |
2023-10-28 10:30:07 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
14ms |
384 KiB |
|
320 Bytes |
2023-4-2 16:34:41 |
|
关博源
|
14ms |
392 KiB |
|
217 Bytes |
2023-4-1 11:20:02 |
|
Accepted (周芷乐)
|
14ms |
6.9 MiB |
C++14 |
290 Bytes |
2024-8-17 15:03:59 |
|
源著校区-宋昊成 (马冬梅)
|
14ms |
512 KiB |
|
578 Bytes |
2023-4-8 18:06:35 |
|
殷语函
|
14ms |
7 MiB |
C++11 |
220 Bytes |
2024-6-15 10:01:51 |
|
11451254188 (22029-mjh)
|
14ms |
512 KiB |
|
420 Bytes |
2022-11-21 13:28:58 |
|
zzl
|
14ms |
6.8 MiB |
|
309 Bytes |
2023-11-7 0:31:45 |
|
时代2校-程俊燃 (chengjunran)
|
14ms |
6.8 MiB |
|
208 Bytes |
2023-10-14 17:05:32 |
|
时代2校+涂彦迪 (tuyandi)
|
14ms |
6.8 MiB |
|
197 Bytes |
2023-10-14 17:10:39 |