|
longhao
|
1ms |
8.1 MiB |
|
97 Bytes |
2022-1-22 18:27:45 |
|
scallway
|
1ms |
8 MiB |
|
88 Bytes |
2022-6-11 17:08:42 |
|
lyc2
|
1ms |
6.7 MiB |
|
91 Bytes |
2022-4-9 18:49:42 |
|
甘梓琪
|
1ms |
8.1 MiB |
|
103 Bytes |
2022-1-21 17:14:02 |
|
baizichen
|
1ms |
8 MiB |
|
99 Bytes |
2022-3-5 14:05:29 |
|
x0l0x
|
1ms |
6.7 MiB |
|
99 Bytes |
2023-9-30 22:23:44 |
|
李华峻 (willy)
|
1ms |
8.2 MiB |
|
92 Bytes |
2022-11-7 17:28:05 |
|
(张洛诚)
|
1ms |
8.1 MiB |
|
103 Bytes |
2022-8-2 19:06:22 |
|
王义苇 (wangyiwei)
|
1ms |
7.8 MiB |
|
80 Bytes |
2023-6-18 13:09:48 |
|
万欣悦
|
1ms |
8.2 MiB |
|
94 Bytes |
2023-5-5 19:20:04 |
|
余晨浩 (yuchenhao)
|
1ms |
8 MiB |
|
88 Bytes |
2022-8-24 15:34:36 |
|
yiqiuyu
|
1ms |
8 MiB |
|
97 Bytes |
2023-4-15 19:12:59 |
|
黄梓桐 (HuangZiTong)
|
1ms |
7.4 MiB |
|
97 Bytes |
2023-3-19 15:31:48 |
|
吴佳智 (AWM)
|
1ms |
7.7 MiB |
|
112 Bytes |
2023-2-4 10:57:51 |
|
陇夕茹
|
2ms |
8 MiB |
|
92 Bytes |
2023-5-13 19:17:49 |
|
李宜帆
|
2ms |
8 MiB |
|
93 Bytes |
2023-2-28 18:15:10 |
|
李荣轩
|
2ms |
8 MiB |
|
94 Bytes |
2023-2-28 18:21:41 |
|
李宜帆
|
2ms |
8 MiB |
|
93 Bytes |
2023-2-28 18:18:04 |
|
郑qr
|
2ms |
7.1 MiB |
C++11 |
86 Bytes |
2024-6-2 13:56:39 |
|
老六145147号
|
2ms |
7.6 MiB |
|
103 Bytes |
2023-3-12 11:13:30 |
|
新一街校区Jason_LuoYouZheng (罗友峥)
|
2ms |
8.1 MiB |
|
80 Bytes |
2022-1-22 11:19:32 |
|
朱老师 (zyp)
|
2ms |
6.7 MiB |
|
101 Bytes |
2023-8-26 19:35:27 |
|
zhanghongsheng23017
|
2ms |
6.7 MiB |
|
90 Bytes |
2023-8-26 19:33:20 |
|
余晨浩 (yuchenhao)
|
2ms |
8 MiB |
|
88 Bytes |
2022-8-24 15:34:37 |
|
🐉ψ(`∇´)ψ (我是蕾神)
|
2ms |
8 MiB |
|
97 Bytes |
2022-2-26 18:39:36 |
|
余晨浩 (yuchenhao)
|
2ms |
7.7 MiB |
|
88 Bytes |
2022-8-24 15:36:16 |
|
zhangzhixiong
|
2ms |
8.2 MiB |
|
98 Bytes |
2022-11-27 14:06:58 |
|
吴佳智 (AWM)
|
2ms |
7.7 MiB |
|
112 Bytes |
2023-2-4 10:57:51 |
|
朱老师 (zyp)
|
2ms |
6.3 MiB |
C++11 |
105 Bytes |
2024-4-16 21:07:21 |
|
advent259
|
2ms |
7.1 MiB |
C++14(O2) |
83 Bytes |
2024-5-16 16:25:34 |
|
郑qr
|
2ms |
7.1 MiB |
C++11 |
86 Bytes |
2024-6-2 13:56:20 |
|
jjbo
|
2ms |
6.7 MiB |
|
93 Bytes |
2023-9-2 16:27:25 |
|
(张洛诚)
|
2ms |
8.1 MiB |
|
103 Bytes |
2022-8-2 19:06:23 |
|
许嘉恩 (xje22031)
|
2ms |
7.1 MiB |
|
99 Bytes |
2022-10-4 22:28:10 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
2ms |
6.6 MiB |
|
102 Bytes |
2022-7-2 17:10:07 |
|
郑qr
|
2ms |
7.2 MiB |
C++11 |
86 Bytes |
2024-6-2 13:59:12 |
|
孙渝灏
|
2ms |
6.9 MiB |
C++11 |
91 Bytes |
2024-8-22 17:14:18 |
|
天天(聂振洺) (icefall)
|
2ms |
6.8 MiB |
C++98(O2) |
95 Bytes |
2024-8-7 17:07:22 |
|
代尚函 笛卡尔 (daishanghan)
|
2ms |
8 MiB |
|
87 Bytes |
2023-5-11 18:56:17 |
|
ymh
|
2ms |
7.1 MiB |
|
86 Bytes |
2022-3-26 16:24:13 |
|
纪承熙
|
2ms |
8 MiB |
|
127 Bytes |
2022-2-19 19:02:11 |
|
邵柏然 (qqqqq)
|
2ms |
8.1 MiB |
|
111 Bytes |
2022-4-15 20:56:50 |
|
(张洛诚)
|
2ms |
8.1 MiB |
|
103 Bytes |
2022-8-2 19:06:22 |
|
SYH.邵允涵 (Zoe邵)
|
2ms |
6.7 MiB |
|
130 Bytes |
2023-3-20 14:27:11 |
|
金沙校区-李嘉齐 (李嘉齐)
|
2ms |
6.7 MiB |
|
93 Bytes |
2023-9-2 10:26:20 |
|
黄梓桐 (HuangZiTong)
|
2ms |
7.8 MiB |
|
97 Bytes |
2023-3-19 15:31:49 |
|
杨在云 (yangzaiyun001)
|
2ms |
8.2 MiB |
|
92 Bytes |
2022-7-19 11:32:05 |
|
ysf.wlanwq.ZJSWL 1922~1991 (韦舒豪)
|
2ms |
6.8 MiB |
C++98 |
625 Bytes |
2024-8-9 13:22:20 |
|
yh1
|
2ms |
6.7 MiB |
|
86 Bytes |
2023-3-19 15:29:46 |
|
纪承熙
|
2ms |
8 MiB |
|
127 Bytes |
2022-2-19 19:02:09 |
|
ysf.wlanwq.ZJSWL 1922~1991 (韦舒豪)
|
2ms |
6.8 MiB |
C++98 |
625 Bytes |
2024-8-9 13:22:04 |
|
linjiayu
|
2ms |
8 MiB |
|
81 Bytes |
2023-3-10 20:16:12 |
|
🙅 (SJCo)
|
2ms |
6.8 MiB |
C++20(O2) |
85 Bytes |
2024-6-1 20:35:02 |
|
郭征华第一忠实粉丝
|
2ms |
8.1 MiB |
|
96 Bytes |
2022-7-22 21:04:10 |
|
手搓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)
|
2ms |
8.2 MiB |
|
95 Bytes |
2022-11-26 11:44:11 |
|
赵泳鑫 (zhaoyongxin)
|
2ms |
8.2 MiB |
|
100 Bytes |
2022-1-19 18:10:43 |
|
ysf.wlanwq.ZJSWL 1922~1991 (韦舒豪)
|
2ms |
6.8 MiB |
C++98 |
625 Bytes |
2024-8-17 18:19:22 |
|
孔梓舰
|
2ms |
6.5 MiB |
|
111 Bytes |
2023-9-10 14:52:24 |
|
代尚函 笛卡尔 (daishanghan)
|
2ms |
8 MiB |
|
87 Bytes |
2023-5-11 18:57:21 |
|
罗云志 (luo_yunzhi)
|
2ms |
8 MiB |
|
103 Bytes |
2023-3-4 15:44:31 |
|
毕源博
|
2ms |
7.7 MiB |
|
95 Bytes |
2022-9-3 11:29:33 |
|
xuaonan
|
2ms |
8 MiB |
|
97 Bytes |
2022-2-20 9:24:43 |
|
Guest
|
2ms |
6.9 MiB |
C++98(O2) |
91 Bytes |
2024-8-24 10:43:03 |
|
hxb
|
2ms |
7.5 MiB |
|
87 Bytes |
2022-9-7 18:58:51 |
|
(张洛诚)
|
2ms |
7.5 MiB |
|
103 Bytes |
2023-5-27 19:39:22 |
|
Nico
|
2ms |
6.5 MiB |
|
130 Bytes |
2023-9-10 14:52:23 |
|
古煦涵
|
2ms |
6.5 MiB |
|
93 Bytes |
2023-9-10 14:52:26 |
|
sybs
|
2ms |
8 MiB |
|
83 Bytes |
2022-3-1 18:08:49 |
|
(张洛诚)
|
2ms |
8.1 MiB |
|
103 Bytes |
2022-8-2 19:06:22 |
|
jiaozihuan
|
2ms |
6.8 MiB |
C++98(O2) |
102 Bytes |
2024-8-8 16:47:40 |
|
ltg
|
2ms |
6.6 MiB |
|
81 Bytes |
2022-6-30 20:40:55 |
|
刘老师 (图书管理员)
|
2ms |
6.9 MiB |
C++11 |
95 Bytes |
2024-5-19 17:10:42 |
|
张家赫
|
2ms |
7.8 MiB |
|
92 Bytes |
2023-2-28 18:18:54 |
|
张家赫
|
2ms |
7.8 MiB |
|
92 Bytes |
2023-2-28 18:18:56 |
|
沈煜恒 (一位老六)
|
2ms |
7.1 MiB |
C++98(O2) |
109 Bytes |
2024-5-19 11:05:24 |
|
神秘白客18
|
2ms |
6.9 MiB |
C++98(O2) |
83 Bytes |
2024-8-21 16:57:00 |
|
张晨颢
|
2ms |
6.9 MiB |
C++11 |
94 Bytes |
2024-5-4 16:35:07 |
|
炸鱼4000+ (dxc)
|
2ms |
7 MiB |
C++14(O2) |
97 Bytes |
2024-5-10 22:03:34 |
|
sb (linjiayu23010)
|
2ms |
6.9 MiB |
C++11 |
140 Bytes |
2024-5-25 10:00:15 |
|
heyi
|
2ms |
6.7 MiB |
C++98(O2) |
98 Bytes |
2024-8-6 13:30:32 |
|
坤坤荔枝小黑子 (zhonghaotian22006)
|
2ms |
7.3 MiB |
|
102 Bytes |
2022-7-2 17:10:07 |
|
郑qr
|
2ms |
6.8 MiB |
C++11 |
86 Bytes |
2024-6-2 13:59:20 |
|
侯治鋆
|
2ms |
8 MiB |
|
79 Bytes |
2022-2-25 20:47:30 |
|
李华峻 (willy)
|
2ms |
8.2 MiB |
|
92 Bytes |
2022-11-7 17:28:05 |
|
张梓辰 (DiaoDesi屌德斯)
|
2ms |
8.1 MiB |
|
108 Bytes |
2022-8-1 9:31:38 |
|
Guest
|
2ms |
6.9 MiB |
C++98(O2) |
97 Bytes |
2024-8-24 16:52:50 |
|
李华峻 (willy)
|
2ms |
8.2 MiB |
|
92 Bytes |
2022-11-7 17:27:54 |
|
Accepted (周芷乐)
|
2ms |
6.9 MiB |
|
177 Bytes |
2023-11-11 10:05:17 |
|
灿灿 (CAN)
|
2ms |
7.8 MiB |
|
133 Bytes |
2022-5-9 19:20:27 |
|
朱泽晟
|
2ms |
8.2 MiB |
|
72 Bytes |
2022-12-12 8:42:48 |
|
凌胥桐1
|
3ms |
6.9 MiB |
|
93 Bytes |
2023-11-11 10:08:07 |
|
唐翰
|
3ms |
7 MiB |
|
94 Bytes |
2023-12-24 19:41:44 |
|
周琳竣1
|
3ms |
7 MiB |
|
92 Bytes |
2023-12-3 18:00:37 |
|
WSY
|
3ms |
6.8 MiB |
|
92 Bytes |
2023-11-19 15:00:07 |
|
孙嘉蔚
|
3ms |
7 MiB |
|
105 Bytes |
2023-11-18 17:28:25 |
|
孙洋洋
|
3ms |
6.9 MiB |
|
101 Bytes |
2023-11-11 17:48:52 |
|
宋金龙 (songjl0421)
|
3ms |
6.9 MiB |
|
91 Bytes |
2023-11-18 17:02:12 |
|
刘老师 (图书管理员)
|
3ms |
7 MiB |
|
101 Bytes |
2023-11-18 17:17:57 |
|
王芃淏
|
3ms |
6.3 MiB |
|
95 Bytes |
2023-11-9 18:49:38 |
|
黄翼廷
|
3ms |
7 MiB |
|
100 Bytes |
2023-11-18 17:19:40 |