This documentation is automatically generated by online-judge-tools/verification-helper
View the Project on GitHub dnx04/algo
#include "misc/offset_vector.hpp"
template <typename V> struct offset_vector { // Index should be in [minIndex, maxIndex]. // minIndex and maxIndex can be negative. offset_Vector(int minIndex, int maxIndex) { x.resize(maxIndex - minIndex + 1); offset = minIndex; } V& operator[](int index) { return x[index - offset]; } auto begin() { return x.begin(); } auto end() { return x.end(); } auto size() { return x.size(); } private: vector<V> x; int offset; };
#line 1 "misc/offset_vector.hpp" template <typename V> struct offset_vector { // Index should be in [minIndex, maxIndex]. // minIndex and maxIndex can be negative. offset_Vector(int minIndex, int maxIndex) { x.resize(maxIndex - minIndex + 1); offset = minIndex; } V& operator[](int index) { return x[index - offset]; } auto begin() { return x.begin(); } auto end() { return x.end(); } auto size() { return x.size(); } private: vector<V> x; int offset; };