HackerRank: Fraudulent activity notification
Bad Habits
I'd get out of the habit of including bits/stdc++.h as it's non-standard and makes your compile times much longer than they need to be. Especially with such a short program.
Likewise, using namespace std can lead to problems and should be avoided.
Naming
You should use clearer variable and function names. The function name activityNotifications() sounds like it could be presenting the user with notifications. Or it could be processing activity notifications. Instead it's counting them. It might be better named countActivityNotifications().
Within the function, you have a few good variable names. Namely, median and results. I have no idea what dq stands for, which means I also have no idea what dq_idx stands for (beyond that it's an index for dq). expenditure is singular, but it holds multiple expenditures, so I'd make the name plural. d is unhelpful as well. Just because the problem description named the variables n and d doesn't mean your code should use those names. They should be numberOfExpenditureDays and numberOfTrailingDays. (If you prefer num to number and removing Of, that's fine.)
Simplify
You don't need to sort the expenditures. You can get the median by generating a histogram and finding the middle value. A histogram is just an array where each element is the number of times that value was in the input. So a histogram of expenditures would hold the count of how many expenditures were for 1 dollar, and 2 dollars, and 3 dollars, etc. Since the expenditures are between 0 and 200 dollars each, you would have 200 buckets in your histogram. Furthermore, since you're dealing with trailing days, once you have the first one calculated, you can simply update 2 values on each subsequent pass. (Decrement the expenditure from the day that's falling off the array and increment the one that's being added in.)
Your split_string() function goes to a lot of trouble to clean the string before you tokenize it. But you don't need to. You can simply not add empty strings to the results. Something like this:
void split(const std::string&amp; s, std::vector&lt;std::string&gt;&amp; results)
{
    size_t lastPos = 0;
    size_t nextPos = 0;
    while ((nextPos = s.find(&quot; &quot;, lastPos)) != std::string::npos)
    {
        std::string word = s.substr(lastPos, nextPos - lastPos);
        if (!word.empty()) {
            results.push_back(word);
        }
        lastPos = nextPos + 1;
    }
    
    if (lastPos != std::string::npos)
    {
        std::string word = s.substr(lastPos, std::string::npos);
        if (!word.empty())
        {
            results.push_back(word);
        }
    }
}

I had to read your function several times to realize what it was trying to do with std::unique(), std::string::erase(), and std::string::pop_back().
Readability
The activityNotifications() function is really hard to read due to the odd, inconsistent spacing it uses. I recommend a space before and after every operator to make it more clear. So this line, for example:
dq_idx=(dq_idx+1) %d;

is more readable when written like this:
dq_idx = (dq_idx + 1) % d;