|
姚宏逸
|
3ms |
256 KiB |
|
246 Bytes |
2022-5-30 22:42:12 |
|
1396013295
|
3ms |
256 KiB |
|
248 Bytes |
2022-1-22 18:24:10 |
|
LUKHE (LukeHu)
|
3ms |
264 KiB |
|
259 Bytes |
2022-1-25 18:48:14 |
|
wangruibo20xh
|
3ms |
256 KiB |
|
246 Bytes |
2022-2-11 14:25:33 |
|
胡宸华 (huchenhua)
|
3ms |
312 KiB |
|
194 Bytes |
2022-3-25 18:51:22 |
|
赵沛喆
|
3ms |
256 KiB |
|
204 Bytes |
2022-4-10 10:09:55 |
|
冒牌陈杰晟【MOD】 (wed)
|
3ms |
304 KiB |
|
229 Bytes |
2022-3-6 15:44:38 |
|
汪致卉 (wangzh)
|
3ms |
256 KiB |
|
229 Bytes |
2022-1-23 18:27:42 |
|
陈雨泽1
|
3ms |
308 KiB |
|
231 Bytes |
2023-2-18 11:24:17 |
|
lch (凌昌瀚)
|
6ms |
384 KiB |
|
189 Bytes |
2022-6-11 23:03:34 |
|
hst
|
6ms |
384 KiB |
|
238 Bytes |
2022-5-12 15:37:31 |
|
maomao
|
6ms |
440 KiB |
|
220 Bytes |
2022-5-26 22:05:15 |
|
林小博
|
6ms |
384 KiB |
|
211 Bytes |
2022-6-18 11:02:50 |
|
李山水
|
6ms |
384 KiB |
|
246 Bytes |
2022-2-20 9:24:54 |
|
张景豪
|
6ms |
384 KiB |
|
203 Bytes |
2023-2-18 20:52:31 |
|
吴俊成 (wujuncheng)
|
6ms |
392 KiB |
|
222 Bytes |
2022-7-11 10:22:38 |
|
许梓宸 (xuzichen)
|
6ms |
6.7 MiB |
C++17(O2) |
195 Bytes |
2024-7-17 16:20:50 |
|
无尽的想象 (谭仕高)
|
6ms |
384 KiB |
|
204 Bytes |
2022-7-29 16:54:54 |
|
侯治鋆
|
6ms |
384 KiB |
|
189 Bytes |
2022-6-10 20:44:12 |
|
Yuan (Zongzi1)
|
6ms |
6.7 MiB |
C++17(O2) |
238 Bytes |
2024-7-18 16:34:37 |
|
Nico
|
6ms |
384 KiB |
|
232 Bytes |
2023-4-30 15:00:48 |
|
林小博
|
6ms |
400 KiB |
|
211 Bytes |
2022-6-18 10:58:08 |
|
王乐仪
|
6ms |
400 KiB |
|
207 Bytes |
2022-2-4 17:41:54 |
|
luoluonuoya
|
6ms |
388 KiB |
|
222 Bytes |
2022-2-7 16:16:24 |
|
yanglang
|
6ms |
412 KiB |
|
203 Bytes |
2023-2-12 8:11:05 |
|
hnd (陈皓洋)
|
6ms |
384 KiB |
|
240 Bytes |
2023-4-8 14:00:20 |
|
杜俊宏
|
6ms |
384 KiB |
|
199 Bytes |
2022-4-26 20:45:31 |
|
MoonLight ( aaa)
|
6ms |
384 KiB |
|
401 Bytes |
2022-1-26 20:31:28 |
|
王晨志 (wangchenzhi)
|
6ms |
384 KiB |
|
277 Bytes |
2022-6-18 4:38:07 |
|
彭嘉豪 (pengjiahao)
|
6ms |
448 KiB |
|
2.1 KiB |
2022-7-29 12:40:56 |
|
Randy Marsh (杨子腾)
|
6ms |
432 KiB |
|
252 Bytes |
2022-5-19 18:31:42 |
|
444444444 (唐跃元)
|
6ms |
384 KiB |
|
207 Bytes |
2023-4-8 14:00:27 |
|
yh1
|
6ms |
392 KiB |
|
196 Bytes |
2023-4-21 21:43:09 |
|
炼狱杏寿郎(的粉粉粉粉粉) (sheijiangwohh)
|
6ms |
416 KiB |
|
314 Bytes |
2022-2-26 14:40:29 |
|
关博源
|
6ms |
384 KiB |
|
249 Bytes |
2023-4-9 15:40:44 |
|
zhou_1004
|
6ms |
384 KiB |
|
261 Bytes |
2022-2-20 9:15:45 |
|
新一街校区Jason_LuoYouZheng (罗友峥)
|
6ms |
384 KiB |
|
186 Bytes |
2022-2-26 10:14:40 |
|
手搓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)
|
6ms |
384 KiB |
|
255 Bytes |
2023-2-5 17:48:50 |
|
黄梓桐 (HuangZiTong)
|
6ms |
392 KiB |
|
214 Bytes |
2022-8-3 16:29:53 |
|
詹宇航 (zyh7)
|
6ms |
384 KiB |
|
194 Bytes |
2022-6-12 20:59:11 |
|
李山水
|
6ms |
384 KiB |
|
246 Bytes |
2022-2-20 9:24:54 |
|
金沙校区-蓝祥与 (蓝祥与)
|
6ms |
384 KiB |
|
206 Bytes |
2023-4-8 14:01:56 |
|
cxk123 (tanzixuan)
|
6ms |
400 KiB |
|
202 Bytes |
2023-2-18 20:47:32 |
|
郑尧 (zhengyao)
|
6ms |
384 KiB |
|
228 Bytes |
2023-2-18 20:51:56 |
|
kcs007
|
6ms |
512 KiB |
|
206 Bytes |
2023-4-8 14:00:15 |
|
yu (赵子瑜)
|
6ms |
384 KiB |
|
208 Bytes |
2022-2-24 21:07:44 |
|
miku (阳沐珊)
|
6ms |
384 KiB |
|
210 Bytes |
2022-6-18 11:02:54 |
|
ywh
|
6ms |
384 KiB |
|
285 Bytes |
2022-2-26 10:13:52 |
|
陈杰晟
|
6ms |
384 KiB |
|
250 Bytes |
2022-2-20 11:26:09 |
|
刘沄熙
|
6ms |
424 KiB |
|
264 Bytes |
2022-8-14 15:03:37 |
|
王祎辰 (wangyichen)
|
6ms |
384 KiB |
|
265 Bytes |
2023-2-18 20:47:14 |
|
郭人瑀作业号
|
6ms |
440 KiB |
|
201 Bytes |
2022-8-2 16:20:57 |
|
🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕🖕 (bro)
|
6ms |
436 KiB |
|
232 Bytes |
2022-1-25 13:11:56 |
|
heyuzhe
|
6ms |
6.9 MiB |
C++98 |
224 Bytes |
2024-8-16 8:49:44 |
|
张祖名
|
6ms |
6.9 MiB |
C++98(O2) |
226 Bytes |
2024-6-10 22:00:54 |
|
文硕 (文硕1)
|
6ms |
428 KiB |
|
209 Bytes |
2023-2-1 8:41:54 |
|
78688997654411453242424543454454543452443445241445145443452445354544544342454434542525444455744634634664264657444634348434818138746578665154421435447684534354945574687821415141717181545464564565825468782855858585554875585 (唐翰)
|
6ms |
6.7 MiB |
C++98 |
193 Bytes |
2024-7-23 14:23:16 |
|
zcx
|
6ms |
384 KiB |
|
210 Bytes |
2023-2-11 11:07:59 |
|
wangzhijie
|
6ms |
384 KiB |
|
238 Bytes |
2022-2-26 14:13:00 |
|
xiongxinyao
|
6ms |
444 KiB |
|
219 Bytes |
2022-2-26 10:17:18 |
|
疯神芭芭脱丝 (李卓修)
|
6ms |
392 KiB |
|
214 Bytes |
2022-7-14 10:54:50 |
|
SB (mfy01)
|
6ms |
432 KiB |
|
204 Bytes |
2023-2-3 17:40:20 |
|
赵鑫宸 (xiaoxiao721)
|
7ms |
384 KiB |
|
255 Bytes |
2022-2-26 18:36:49 |
|
时代一校林星宇 (lxy)
|
7ms |
384 KiB |
|
215 Bytes |
2022-6-4 19:55:44 |
|
我推忘归人 (贺俊楠)
|
7ms |
384 KiB |
|
199 Bytes |
2023-4-30 14:20:35 |
|
宋金龙 (songjl0421)
|
7ms |
384 KiB |
|
205 Bytes |
2022-1-22 18:16:11 |
|
ymh
|
7ms |
384 KiB |
|
202 Bytes |
2022-2-26 14:39:44 |
|
piter
|
7ms |
384 KiB |
|
234 Bytes |
2022-2-26 14:13:32 |
|
wuqilin
|
7ms |
384 KiB |
|
203 Bytes |
2023-4-1 10:37:56 |
|
樊竣熠 (lft1114)
|
7ms |
384 KiB |
|
293 Bytes |
2022-2-23 21:39:29 |
|
谢延灏 (xeiyanhao---a handsome boy)
|
7ms |
512 KiB |
|
219 Bytes |
2022-4-8 18:53:20 |
|
廖海宇在追杀马牌痞 (liaohaiyu22031)
|
7ms |
444 KiB |
|
257 Bytes |
2023-2-4 11:26:00 |
|
李彭 宋代诗人 (ljy123456)
|
7ms |
392 KiB |
|
361 Bytes |
2023-3-22 16:59:44 |
|
200800
|
7ms |
7.1 MiB |
|
204 Bytes |
2023-12-3 15:42:18 |
|
罗竣瀚
|
7ms |
384 KiB |
|
195 Bytes |
2023-4-8 13:58:48 |
|
罗竣瀚
|
7ms |
396 KiB |
|
195 Bytes |
2023-4-8 13:58:01 |
|
NJL (NJlL)
|
7ms |
428 KiB |
|
211 Bytes |
2022-5-8 18:54:01 |
|
谢博文
|
7ms |
392 KiB |
|
242 Bytes |
2022-2-26 10:13:05 |
|
程子杰 (05c41-czj)
|
7ms |
432 KiB |
|
199 Bytes |
2022-7-27 10:48:40 |
|
huyinuo
|
7ms |
448 KiB |
|
245 Bytes |
2022-5-25 21:34:15 |
|
罗兰(漆黑襟默) (zhangxiaoci)
|
7ms |
384 KiB |
|
203 Bytes |
2023-4-8 14:03:21 |
|
经常消失 (小萝卜)
|
7ms |
384 KiB |
|
230 Bytes |
2022-2-26 14:13:13 |
|
陈红恺 (chk)
|
7ms |
384 KiB |
|
186 Bytes |
2022-8-16 11:10:34 |
|
dyp (hhy)
|
7ms |
6.9 MiB |
|
230 Bytes |
2023-8-26 11:18:55 |
|
杨坤霖 (steven)
|
7ms |
392 KiB |
|
227 Bytes |
2022-11-26 12:55:32 |
|
付博plus
|
7ms |
384 KiB |
|
204 Bytes |
2023-4-8 14:02:18 |
|
繁星 (05c35-zzm)
|
7ms |
384 KiB |
|
242 Bytes |
2022-12-2 8:51:28 |
|
阮 (媚狐不吃道旁李)
|
7ms |
7 MiB |
C++98 |
227 Bytes |
2024-5-25 16:34:53 |
|
zhangzixuanaa
|
7ms |
384 KiB |
|
230 Bytes |
2023-4-8 13:48:35 |
|
李哲 (lizhe)
|
7ms |
392 KiB |
|
214 Bytes |
2022-8-24 19:24:15 |
|
曹元明
|
7ms |
440 KiB |
|
239 Bytes |
2022-8-17 11:46:55 |
|
李山水
|
7ms |
384 KiB |
|
246 Bytes |
2022-2-20 9:24:54 |
|
李某人
|
7ms |
384 KiB |
|
230 Bytes |
2022-2-11 15:44:31 |
|
李树崑 (lishukun)
|
7ms |
384 KiB |
|
274 Bytes |
2022-2-26 14:13:00 |
|
右边的右边的人是SB (22016-hjy)
|
7ms |
436 KiB |
|
213 Bytes |
2022-9-27 21:04:38 |
|
曹埊睿 (caodirui)
|
7ms |
392 KiB |
|
249 Bytes |
2023-5-5 19:37:21 |
|
hst
|
7ms |
384 KiB |
|
238 Bytes |
2022-3-12 17:48:59 |
|
王玺懿 (wxy)
|
7ms |
436 KiB |
|
235 Bytes |
2022-9-11 12:44:51 |
|
RanHao
|
7ms |
6.9 MiB |
|
295 Bytes |
2023-7-16 12:01:23 |
|
执剑人罗辑 (Jasson)
|
7ms |
440 KiB |
|
221 Bytes |
2023-4-22 14:52:16 |