|
邱越
|
- |
7 MiB |
|
111 Bytes |
2023-12-21 19:25:09 |
|
Guest
|
- |
6.9 MiB |
|
105 Bytes |
2023-11-28 20:01:05 |
|
hyh22031()
|
- |
7 MiB |
|
93 Bytes |
2024-1-7 9:42:26 |
|
欣欣
|
- |
6.5 MiB |
|
97 Bytes |
2023-11-19 14:59:24 |
|
时代一校-吴琪磷 (jiku)
|
- |
6.8 MiB |
|
91 Bytes |
2023-11-28 19:50:07 |
|
孩纸
|
- |
6.8 MiB |
|
94 Bytes |
2023-11-19 14:55:39 |
|
孩纸
|
- |
6.8 MiB |
|
94 Bytes |
2023-11-19 14:51:53 |
|
拥抱幸福小熊(吴沛篪)
|
- |
6.8 MiB |
|
92 Bytes |
2023-12-2 8:57:29 |
|
小可爱
|
- |
6.9 MiB |
|
92 Bytes |
2023-12-9 19:05:20 |
|
拥抱幸福小熊(吴沛篪)
|
- |
7 MiB |
|
92 Bytes |
2023-12-30 9:14:06 |
|
lzy2(摸鱼)
|
- |
7 MiB |
|
79 Bytes |
2024-1-12 11:56:29 |
|
龚铭俊 (哈哈哈)
|
- |
7.1 MiB |
|
243 Bytes |
2023-11-26 10:35:17 |
|
马安馨
|
- |
6.9 MiB |
|
92 Bytes |
2023-12-31 15:08:17 |
|
ysf.wlanwq.ZJSWL 1922~1991 (韦舒豪)
|
- |
7 MiB |
|
93 Bytes |
2024-1-6 11:19:34 |
|
jdy
|
- |
6.8 MiB |
|
124 Bytes |
2023-11-30 18:54:27 |
|
刘思齐
|
- |
7 MiB |
|
109 Bytes |
2023-11-18 17:21:35 |
|
Qinxiu
|
- |
7.1 MiB |
|
79 Bytes |
2023-12-3 10:02:15 |
|
ysf.wlanwq.ZJSWL 1922~1991 (韦舒豪)
|
- |
7 MiB |
|
93 Bytes |
2024-1-6 11:19:26 |
|
龚铭俊 (哈哈哈)
|
- |
6.8 MiB |
|
97 Bytes |
2023-11-26 10:28:35 |
|
龚铭俊 (哈哈哈)
|
- |
6.9 MiB |
|
97 Bytes |
2023-11-26 10:28:27 |
|
丁一轩
|
- |
7 MiB |
|
95 Bytes |
2023-12-23 16:07:19 |
|
张三
|
- |
6.7 MiB |
|
124 Bytes |
2023-11-24 19:24:27 |
|
我是小冉睦🐏 (test0114)
|
- |
7.3 MiB |
|
92 Bytes |
2024-1-17 18:05:28 |
|
胡程禹
|
- |
6.9 MiB |
|
79 Bytes |
2023-12-2 18:27:33 |
|
嘿嘿
|
- |
6.9 MiB |
|
117 Bytes |
2024-1-17 20:29:40 |
|
阎雨辰
|
- |
6.6 MiB |
|
91 Bytes |
2023-11-19 15:00:45 |
|
安一谦
|
- |
7 MiB |
|
94 Bytes |
2023-12-16 13:07:51 |
|
新壹街校区-陈琬舒 (空空大师)
|
- |
7.1 MiB |
|
142 Bytes |
2024-1-6 11:40:24 |
|
吴宗骏
|
- |
6.7 MiB |
|
97 Bytes |
2023-12-2 9:15:22 |
|
K517
|
- |
6.9 MiB |
|
95 Bytes |
2023-12-2 19:03:47 |
|
sb (孙浩森)
|
- |
7 MiB |
|
94 Bytes |
2023-11-12 9:38:03 |
|
邓皓轩
|
- |
6.9 MiB |
|
228 Bytes |
2023-11-11 10:14:20 |
|
杜雨帆
|
- |
7 MiB |
|
101 Bytes |
2023-12-31 16:38:01 |
|
yuqihao
|
- |
6.9 MiB |
|
103 Bytes |
2023-12-16 9:16:48 |
|
zongzi. (何泊毅)
|
- |
7 MiB |
|
120 Bytes |
2023-12-23 14:02:39 |
|
Him (李俊熙)
|
- |
7 MiB |
|
131 Bytes |
2023-12-6 18:07:32 |
|
Guest
|
- |
6.9 MiB |
|
104 Bytes |
2023-11-28 19:17:16 |
|
He Yiqi (和平精英)
|
- |
7.1 MiB |
|
584 Bytes |
2023-12-24 14:34:18 |
|
小白白
|
- |
6.8 MiB |
|
103 Bytes |
2023-11-24 19:23:24 |
|
WSY
|
- |
6.8 MiB |
|
97 Bytes |
2023-11-19 15:01:22 |
|
曾维思
|
- |
6.9 MiB |
|
98 Bytes |
2023-12-16 18:48:20 |
|
赵奕铭
|
- |
7 MiB |
|
94 Bytes |
2023-12-23 17:01:56 |
|
新壹街校区-吴鑫鹏 (吴鑫鹏)
|
- |
6.9 MiB |
|
111 Bytes |
2023-12-1 19:46:20 |
|
https://www.crazygames.com/game/merge-construct (陈诺)
|
- |
7 MiB |
|
86 Bytes |
2023-12-1 21:34:32 |
|
ysf.wlanwq.ZJSWL 1922~1991 (韦舒豪)
|
- |
7.1 MiB |
|
93 Bytes |
2024-1-6 11:19:16 |
|
时代一校-赵彦博 (zyb)
|
- |
7 MiB |
|
98 Bytes |
2024-1-12 22:30:45 |
|
徐伟宸 (徐伟宸1)
|
- |
7 MiB |
|
93 Bytes |
2023-11-12 14:59:09 |
|
手搓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)
|
- |
6.9 MiB |
|
65 Bytes |
2023-11-12 8:58:02 |
|
勾晨禹
|
- |
7.1 MiB |
|
95 Bytes |
2024-1-18 21:10:24 |
|
新壹街-陈恺曦 (陈恺曦)
|
- |
6.9 MiB |
|
92 Bytes |
2023-12-21 18:33:39 |
|
姚宏逸
|
0ms |
8.2 MiB |
Pascal |
61 Bytes |
2022-11-29 11:30:40 |
|
姚宏逸
|
0ms |
8.2 MiB |
Pascal |
38 Bytes |
2022-11-29 11:38:53 |
|
yizixun
|
1ms |
7.8 MiB |
C |
69 Bytes |
2022-5-3 19:41:52 |
|
yizixun
|
1ms |
7.8 MiB |
C |
74 Bytes |
2022-1-24 9:38:49 |
|
刘老师 (图书管理员)
|
1ms |
8 MiB |
C |
72 Bytes |
2023-1-21 20:09:01 |
|
yizixun
|
1ms |
7.8 MiB |
C |
74 Bytes |
2022-1-24 9:36:28 |
|
yizixun
|
1ms |
7.8 MiB |
C |
69 Bytes |
2022-5-3 19:41:57 |
|
yizixun
|
1ms |
7.8 MiB |
C |
56 Bytes |
2022-1-24 9:01:29 |
|
qwerty
|
1ms |
7.2 MiB |
C |
60 Bytes |
2022-2-11 17:41:19 |
|
樱岛の花
|
1ms |
6.9 MiB |
C |
74 Bytes |
2022-4-3 9:08:27 |
|
yizixun
|
1ms |
7.8 MiB |
C |
69 Bytes |
2022-5-3 19:41:58 |
|
yizixun
|
1ms |
7.9 MiB |
C |
79 Bytes |
2022-1-23 16:22:45 |
|
yizixun
|
1ms |
8.2 MiB |
C |
79 Bytes |
2022-1-18 21:16:35 |
|
CQ01_LiuZunAo
|
1ms |
8.2 MiB |
C |
70 Bytes |
2022-1-15 10:54:19 |
|
yizixun
|
1ms |
7.8 MiB |
C |
69 Bytes |
2022-5-3 19:41:56 |
|
yizixun
|
1ms |
8.1 MiB |
C |
74 Bytes |
2022-8-4 0:02:25 |
|
yizixun
|
1ms |
7.9 MiB |
C |
79 Bytes |
2022-1-23 23:21:27 |
|
JIANGYUNHAN
|
1ms |
7.9 MiB |
C |
73 Bytes |
2022-4-16 21:03:10 |
|
yizixun
|
1ms |
8.2 MiB |
C |
79 Bytes |
2022-1-18 21:17:13 |
|
11111
|
1ms |
8.1 MiB |
C |
71 Bytes |
2022-7-21 12:16:10 |
|
yumingjie111
|
1ms |
6.8 MiB |
C++98(O2) |
94 Bytes |
2024-6-28 11:14:30 |
|
小火龙
|
1ms |
6.7 MiB |
C++98(O2) |
96 Bytes |
2024-6-29 18:11:00 |
|
肖宇航1
|
1ms |
6.9 MiB |
C++11 |
97 Bytes |
2024-6-27 18:48:40 |
|
Error404sans
|
1ms |
6.8 MiB |
C++20(O2) |
98 Bytes |
2024-6-29 10:28:33 |
|
zvt_132 (任子轩)
|
1ms |
6.6 MiB |
C++98 |
135 Bytes |
2024-7-25 20:56:33 |
|
tongxiao
|
1ms |
6.7 MiB |
C++20(O2) |
140 Bytes |
2024-7-14 16:32:24 |
|
胡至简
|
1ms |
6.5 MiB |
C++20 |
105 Bytes |
2024-7-13 16:25:34 |
|
gengyijun
|
1ms |
6.8 MiB |
C++11 |
86 Bytes |
2024-6-29 16:02:37 |
|
Guest
|
1ms |
6.7 MiB |
C++98(O2) |
108 Bytes |
2024-6-25 20:03:09 |
|
gengyijun
|
1ms |
6.8 MiB |
C++11 |
86 Bytes |
2024-6-29 15:59:06 |
|
张祖名
|
1ms |
6.6 MiB |
C++98(O2) |
99 Bytes |
2024-7-2 10:22:22 |
|
肖杰睿
|
1ms |
6.9 MiB |
C++17 |
93 Bytes |
2024-5-25 8:55:54 |
|
11111111
|
1ms |
6.8 MiB |
C++98(O2) |
83 Bytes |
2024-5-25 18:12:36 |
|
江子墨
|
1ms |
6.7 MiB |
C++98 |
96 Bytes |
2024-6-7 15:28:58 |
|
崔欧辰
|
1ms |
6.7 MiB |
C++11 |
109 Bytes |
2024-7-12 20:28:17 |
|
邱海川 (qhc)
|
1ms |
6.5 MiB |
C++11 |
97 Bytes |
2024-7-21 18:52:34 |
|
kql1
|
1ms |
6.9 MiB |
C++98 |
97 Bytes |
2024-5-9 12:54:51 |
|
苏承泽
|
1ms |
6.2 MiB |
C++98(O2) |
94 Bytes |
2024-7-20 21:47:14 |
|
Guest
|
1ms |
6.7 MiB |
|
70 Bytes |
2023-9-24 17:17:15 |
|
余sy
|
1ms |
6.9 MiB |
C++11 |
87 Bytes |
2024-6-2 13:57:30 |
|
吵吵小小 (超级小白)
|
1ms |
6.8 MiB |
C++98 |
97 Bytes |
2024-8-15 10:13:05 |
|
Guest
|
1ms |
6.6 MiB |
C++98(O2) |
97 Bytes |
2024-7-12 14:24:38 |
|
一朵桃桃
|
1ms |
6.8 MiB |
C++98(O2) |
96 Bytes |
2024-6-8 19:41:16 |
|
爱琴海校区-刁钲洋 (刁钲洋)
|
1ms |
6.9 MiB |
C++98 |
96 Bytes |
2024-6-24 21:07:48 |
|
ysf.wlanwq.ZJSWL 1922~1991 (韦舒豪)
|
1ms |
6.6 MiB |
C++98 |
625 Bytes |
2024-7-24 16:13:28 |
|
XZY
|
1ms |
6.7 MiB |
|
72 Bytes |
2023-9-24 17:18:47 |
|
cljz
|
1ms |
6.9 MiB |
C++17 |
97 Bytes |
2024-6-4 20:16:43 |
|
Guest
|
1ms |
6.7 MiB |
C++98(O2) |
119 Bytes |
2024-7-14 16:35:32 |
|
ysf.wlanwq.ZJSWL 1922~1991 (韦舒豪)
|
1ms |
6.2 MiB |
C++98 |
98 Bytes |
2024-7-29 15:05:38 |
|
董乙辰
|
1ms |
6.8 MiB |
|
91 Bytes |
2023-11-4 16:00:58 |