Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
STL当然慢了In Reply To:Re:差分约束+spfa险过!! Posted by:_Doraemon at 2010-10-15 13:00:57 它的queue要管理内存啊,queue底层默认用deque实现,当所开空间不够时要申请扩容 (就好比你原来开了一个1w的queue发现不够用了,就得新申请存储空间,才能放下新加进来的元素),凡是涉及动态内存管理的当然慢了…… 自己手写队列的话就是随便浪费空间(我开了一个200w的queue),一次分配好,只要front和rear两个指针不断移动就行了,自然会快很多。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator