Count sub-sequences of an array having median lying in that subsequence itself
Don't #include  &lt;bits/stdc++.h&gt; but explicitly include proper requested headers.
Try to limite uses of using namespace std;, it lead to painfull errors and weird bug.
Don't use preprocessor constants. Instead, use const and constexpr values.
Don't use macro, write directly code or use (inline) (constexpr) function  if you use the same code at much places.
Try to return value instead of taking an input reference.
Avoid old array in favour of std::array.
Don't use register keyword in c++
Don't assign 1 or 0 to a bool, use true and false instead.
getchar return int, why trying to convert to T. 
Try to use C++ iostream instead of getchar or putchar
Instead of magical values, use const char (eg 'A') to express chars bound..
Use curly braces for your statement
Don't try to be smart putting many statement on the same line, separated by comma. It's not.
The expression n *= -1 can by simplified in n = -n
Don't use for loops if you don't want Initialization+Condition+Operation. It's ugly.
Take care about indents.