|
陈奕瑾 (shenxiulinyue)
|
14ms |
428 KiB |
|
178 Bytes |
2022-4-28 22:03:08 |
|
胡瀚文
|
14ms |
384 KiB |
|
191 Bytes |
2022-1-24 10:54:20 |
|
曹雅萱
|
14ms |
6.9 MiB |
C++11 |
188 Bytes |
2024-8-23 16:41:48 |
|
苏信泽
|
14ms |
536 KiB |
|
175 Bytes |
2023-2-18 20:26:53 |
|
杜是贤 (dushixian)
|
14ms |
436 KiB |
|
198 Bytes |
2022-6-5 8:49:45 |
|
Sivan
|
14ms |
6.7 MiB |
C++98(O2) |
174 Bytes |
2024-7-23 15:57:42 |
|
王昕奕
|
14ms |
384 KiB |
|
180 Bytes |
2023-5-12 21:00:16 |
|
(张洛诚)
|
14ms |
428 KiB |
|
220 Bytes |
2023-4-8 7:48:08 |
|
吕同学是傻逼 (黄立信)
|
14ms |
6.8 MiB |
|
183 Bytes |
2023-10-7 22:18:30 |
|
我全家SB!!! 我没母!!! (baijinlin)
|
14ms |
392 KiB |
|
193 Bytes |
2023-3-4 17:01:51 |
|
吴沛宸
|
14ms |
6.9 MiB |
C++11 |
283 Bytes |
2024-6-15 13:45:22 |
|
冯隆浩(小号)
|
14ms |
444 KiB |
|
178 Bytes |
2022-7-27 13:34:36 |
|
刘煜轩
|
14ms |
6.7 MiB |
|
201 Bytes |
2023-9-27 21:28:19 |
|
勾晨禹
|
14ms |
7 MiB |
C++17 |
165 Bytes |
2024-8-23 18:03:35 |
|
WangXi
|
14ms |
384 KiB |
|
179 Bytes |
2022-9-24 17:27:36 |
|
Erin
|
14ms |
7.2 MiB |
C++98 |
183 Bytes |
2024-5-1 14:06:39 |
|
龙湖时代C馆-邹镇宇 (邹镇宇)
|
14ms |
436 KiB |
|
188 Bytes |
2022-7-21 11:43:08 |
|
刘锦航
|
14ms |
384 KiB |
|
170 Bytes |
2022-8-27 17:00:11 |
|
杜俊宏
|
14ms |
436 KiB |
|
180 Bytes |
2022-3-23 21:37:10 |
|
luosifu22006
|
14ms |
512 KiB |
|
193 Bytes |
2022-8-17 17:21:46 |
|
黄彦熹 (AK-203)
|
14ms |
384 KiB |
|
186 Bytes |
2022-8-24 19:11:09 |
|
食不食油饼(点主页康康) (Nemo)
|
14ms |
384 KiB |
|
186 Bytes |
2022-8-20 11:07:56 |
|
严斯扬1
|
14ms |
7 MiB |
C++11 |
179 Bytes |
2024-5-30 19:00:30 |
|
1396013295
|
14ms |
384 KiB |
|
222 Bytes |
2022-1-23 20:04:45 |
|
张子扬
|
14ms |
384 KiB |
|
198 Bytes |
2022-2-19 13:03:46 |
|
He Yiqi (和平精英)
|
14ms |
7.1 MiB |
|
184 Bytes |
2023-6-10 20:21:13 |
|
金锦泽 (jinjinze)
|
14ms |
6.8 MiB |
|
207 Bytes |
2023-10-4 13:02:38 |
|
stehpen_zuo
|
14ms |
7.6 MiB |
C++20 |
328 Bytes |
2024-6-1 15:43:26 |
|
郑岐蔚
|
14ms |
384 KiB |
|
187 Bytes |
2022-9-24 18:50:37 |
|
Jack
|
14ms |
512 KiB |
|
193 Bytes |
2022-8-2 17:04:56 |
|
谭懿轩 (yanyixuan)
|
14ms |
384 KiB |
|
187 Bytes |
2022-1-16 17:08:30 |
|
吴俊成 (wujuncheng)
|
14ms |
436 KiB |
|
245 Bytes |
2022-7-8 23:11:42 |
|
刘鹤枫 (liuhefeng)
|
14ms |
384 KiB |
|
190 Bytes |
2022-8-7 13:57:08 |
|
Billy52013 (李子轩)
|
14ms |
6.8 MiB |
|
178 Bytes |
2023-9-29 15:20:32 |
|
lijinyu23003
|
14ms |
384 KiB |
|
180 Bytes |
2023-3-4 17:03:10 |
|
huanghaoming
|
14ms |
392 KiB |
|
208 Bytes |
2022-8-20 15:18:24 |
|
曹烜豪
|
14ms |
392 KiB |
|
195 Bytes |
2023-2-18 20:31:04 |
|
火爆肥肠(杨弘毅) (火爆肥肠)
|
14ms |
440 KiB |
|
198 Bytes |
2022-2-21 21:36:38 |
|
文硕 (文硕1)
|
14ms |
432 KiB |
|
243 Bytes |
2022-7-12 11:18:21 |
|
新壹街校区-杨轩懿 (杨轩懿1)
|
14ms |
6.7 MiB |
|
171 Bytes |
2023-8-29 10:01:17 |
|
谢延灏 (xeiyanhao---a handsome boy)
|
14ms |
392 KiB |
|
200 Bytes |
2022-1-24 18:56:51 |
|
AV8D (yumingjie11)
|
14ms |
6.9 MiB |
C++98 |
165 Bytes |
2024-6-15 9:14:39 |
|
江子墨
|
14ms |
6.8 MiB |
C++98 |
187 Bytes |
2024-6-27 8:39:27 |
|
美术猫映画 (mkh)
|
14ms |
6.9 MiB |
|
179 Bytes |
2023-7-18 19:10:42 |
|
时代一校-曾科智 (曾科智)
|
14ms |
444 KiB |
|
180 Bytes |
2023-2-25 19:18:54 |
|
新壹街-曾浩坤 (曾浩坤)
|
14ms |
6.7 MiB |
|
162 Bytes |
2023-9-23 10:47:06 |
|
我全家SB!!! 我没母!!! (baijinlin)
|
14ms |
392 KiB |
|
193 Bytes |
2023-3-4 17:01:54 |
|
林小博
|
14ms |
512 KiB |
|
215 Bytes |
2022-4-16 11:10:02 |
|
邵冠铖 (shaoguancheng22031)
|
14ms |
384 KiB |
|
175 Bytes |
2022-10-23 12:09:25 |
|
罗一鸣
|
14ms |
6.8 MiB |
|
163 Bytes |
2023-10-4 16:37:43 |
|
曾凡宸
|
14ms |
6.7 MiB |
|
192 Bytes |
2023-9-24 19:10:28 |
|
国林泽 (guolinze)
|
14ms |
436 KiB |
|
189 Bytes |
2022-3-10 21:34:41 |
|
yangyutong22003
|
14ms |
512 KiB |
|
198 Bytes |
2023-3-4 17:01:02 |
|
余多多29
|
14ms |
512 KiB |
|
189 Bytes |
2023-4-18 22:28:33 |
|
曾龙兮
|
14ms |
384 KiB |
|
168 Bytes |
2022-10-2 18:33:56 |
|
李林峰 (金克拉)
|
14ms |
436 KiB |
|
214 Bytes |
2022-12-9 19:03:52 |
|
zjz
|
14ms |
512 KiB |
|
178 Bytes |
2022-3-20 22:02:19 |
|
苏庭毅
|
14ms |
512 KiB |
|
190 Bytes |
2023-2-18 20:24:21 |
|
拥抱幸福小熊(吴沛篪)
|
14ms |
6.9 MiB |
|
151 Bytes |
2023-10-15 12:04:30 |
|
leisixian (22029-lyh)
|
14ms |
512 KiB |
|
265 Bytes |
2023-2-27 20:45:24 |
|
Him神
|
14ms |
6.7 MiB |
|
174 Bytes |
2023-9-30 0:26:13 |
|
22029-zjs
|
14ms |
6.7 MiB |
|
210 Bytes |
2023-9-24 10:01:53 |
|
LDE__113 (逯典恩)
|
14ms |
512 KiB |
|
187 Bytes |
2022-8-28 18:19:56 |
|
付博plus
|
14ms |
428 KiB |
|
180 Bytes |
2022-9-22 20:28:38 |
|
德克萨斯做的到吗 (liyangbao)
|
14ms |
384 KiB |
|
260 Bytes |
2022-10-30 1:16:58 |
|
李晨希
|
14ms |
384 KiB |
|
193 Bytes |
2023-3-21 17:06:16 |
|
zhangyouze (张佑泽)
|
14ms |
6.8 MiB |
|
211 Bytes |
2023-10-21 17:02:07 |
|
新壹街校区-陈品烨 (陈品烨)
|
14ms |
6.7 MiB |
|
209 Bytes |
2023-10-1 11:10:32 |
|
新壹街校区-周士杰 (zsj)
|
14ms |
384 KiB |
|
175 Bytes |
2023-5-19 18:52:28 |
|
正常的雪糕
|
14ms |
7.2 MiB |
C++98(O2) |
205 Bytes |
2024-4-30 20:55:43 |
|
tthfjnnejnytertgtrfgmkhgthnrfhytghjuytgh (何镇西1)
|
14ms |
6.9 MiB |
|
164 Bytes |
2023-7-27 18:07:55 |
|
手搓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 |
436 KiB |
|
213 Bytes |
2023-5-10 18:28:14 |
|
陈骏逸 (chenjunyi)
|
14ms |
416 KiB |
|
170 Bytes |
2022-7-16 20:09:24 |
|
yu (赵子瑜)
|
14ms |
512 KiB |
|
183 Bytes |
2022-3-2 19:57:44 |
|
向俊熙 (xiangjunxi23003)
|
14ms |
392 KiB |
|
179 Bytes |
2023-3-4 17:03:07 |
|
CK (李弘毅)
|
14ms |
440 KiB |
|
188 Bytes |
2022-7-13 17:51:04 |
|
德意志第三帝国 (陈远桥)
|
14ms |
432 KiB |
|
212 Bytes |
2022-7-14 13:42:12 |
|
唐嘉文
|
14ms |
512 KiB |
|
193 Bytes |
2022-7-17 15:34:46 |
|
xiangsiyu
|
14ms |
508 KiB |
|
159 Bytes |
2022-7-28 20:49:17 |
|
韩思辰 (hansichen)
|
14ms |
512 KiB |
|
209 Bytes |
2022-11-26 9:28:44 |
|
新壹街校区-冉睦阳(想要无敌天下吗,葵花宝典有售,不要18880,只要9999) (冉睦阳)
|
14ms |
7 MiB |
C++98 |
188 Bytes |
2024-8-24 16:26:50 |
|
吴卓轩
|
14ms |
512 KiB |
|
189 Bytes |
2022-9-18 14:56:51 |
|
你爹 (郭铠嘉)
|
14ms |
512 KiB |
|
193 Bytes |
2022-1-25 20:32:32 |
|
huyunyi23003
|
14ms |
392 KiB |
|
210 Bytes |
2023-3-4 17:02:56 |
|
王玺懿 (wxy)
|
14ms |
436 KiB |
|
181 Bytes |
2022-7-22 17:23:15 |
|
司雨来 (siyulai)
|
14ms |
384 KiB |
|
198 Bytes |
2022-10-6 16:31:26 |
|
huyinuo
|
14ms |
512 KiB |
|
190 Bytes |
2022-2-19 21:50:58 |
|
杨淇瑞 (杨淇瑞29)
|
14ms |
440 KiB |
|
191 Bytes |
2023-5-8 20:42:57 |
|
南坪校区-淡昌盛 (Dancs)
|
14ms |
6.8 MiB |
|
192 Bytes |
2023-10-8 19:52:40 |
|
南坪校区-郑力博 (zhenglibo23003)
|
14ms |
392 KiB |
|
180 Bytes |
2023-3-4 16:24:50 |
|
CPL
|
14ms |
6.8 MiB |
|
185 Bytes |
2023-6-14 18:54:05 |
|
贾博涵
|
14ms |
6.8 MiB |
|
143 Bytes |
2023-11-1 15:08:13 |
|
韩思辰 (hansichen)
|
14ms |
384 KiB |
|
209 Bytes |
2022-11-26 9:29:05 |
|
汪致卉 (wangzh)
|
14ms |
436 KiB |
|
208 Bytes |
2022-1-15 21:10:58 |
|
肖添宇
|
14ms |
432 KiB |
|
228 Bytes |
2022-3-19 18:09:25 |
|
hangge
|
14ms |
448 KiB |
|
279 Bytes |
2023-5-29 19:11:36 |
|
蒋丁非凡
|
14ms |
6.9 MiB |
|
187 Bytes |
2023-10-27 20:15:25 |
|
杨颂恩 (yangsongen)
|
14ms |
436 KiB |
|
209 Bytes |
2023-4-28 22:43:34 |
|
江坤锜
|
14ms |
432 KiB |
|
230 Bytes |
2023-2-18 20:27:00 |
|
kkksc03 (彭士锋)
|
14ms |
432 KiB |
|
199 Bytes |
2022-3-5 13:54:16 |