File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
library/data_structures/deque_op Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,6 @@ template<class T, class F> struct deq {
2020 int siz () { return sz (l) + sz (r); }
2121 T front () { return (empty (l) ? r[0 ] : l.back ())[0 ]; }
2222 T back () { return (empty (r) ? l[0 ] : r.back ())[0 ]; }
23- void push_back (T elem) {
24- r.push_back (
25- {elem, empty (r) ? elem : op (r.back ()[1 ], elem)});
26- }
2723 void pop_front () {
2824 if (empty (l)) {
2925 vector<T> a (sz (r));
@@ -33,6 +29,10 @@ template<class T, class F> struct deq {
3329 }
3430 l.pop_back ();
3531 }
32+ void push_back (T elem) {
33+ r.push_back (
34+ {elem, empty (r) ? elem : op (r.back ()[1 ], elem)});
35+ }
3636 void rebuild (const vector<T>& a, int sz_le) {
3737 vector<T> presum (sz (a));
3838 partial_sum (rend (a) - sz_le, rend (a),
You can’t perform that action at this time.
0 commit comments