vectorに範囲チェックが入る環境ならばこうだ。

#ifdef DEBUG

#define ARR(T, A, n) vector<T> A(n);

#else

#define ARR(T, A, n) T *A=new T [n];

#endif