HackerRank leaderboard challenge
don't use using namespace std

You should not use using namespace std because it eliminates some important information, which may lead to some conflicts with your classes or classes of other libraries. It is not uncommon to have a vector class, which has a totally other meaning than the std::vector. And to be honest, it isn't that much more work, to type std:: in front of the classes/functions, is it?

use std algorithms

You do everything with for loops, which is bloated and error prone. Use the algorithms of the std namespace instead. I provide you with a short an clean example, how you could do the above task (and more) with less lines.

your algorithm itself

You should think about logical improvements. Is it necessary to store every score in a vector, when equal scores produce the same rankings, and the following scores just increments by one? Therefore I took the std::unique algorithm, which returns a forward iterator. std::unique doesn't erase anything itself. It just moves duplicates to the end of the range (our std::vector); you have to erase them manually.
But, before you can use std::unique you have to order your elements. I don't know if it's guaranteed to get the score input in a descending order; thus I simply use std::sort to ensure this.
After that, it's a simple std::lower_bound (which is a binary search instead a linear search) to get the first iterator to an element, which is not less than the provided score (ok, I had to pass an other function object, because we want to check for greater and not for less).
Iterators starts with a zero index. This means, we have to add 1 to our index, to get the official ranking.
Easy, huh?

#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;algorithm&gt;
#include &lt;functional&gt;

int main()
{
    std::vector&lt;int&gt; scores { 100, 100, 50, 40, 40, 20, 10 };
    std::vector&lt;int&gt; aliceScores { 5, 25, 50, 120 };
    // sort and erase duplicates
    std::sort(std::begin(scores), std::end(scores), std::greater&lt;int&gt;());
    scores.erase(std::unique(std::begin(scores), std::end(scores)), std::end(scores));

    // just a lambda to make the output part more readable
    auto locateRanking = [](const auto&amp; _scores, int _newScore){
        auto itr = std::lower_bound(std::begin(_scores), std::end(_scores), _newScore, std::greater&lt;int&gt;());
        return std::distance(std::begin(_scores), itr) + 1;
    };

    // output part
    for (auto newScore : aliceScores)
    {
        std::cout &lt;&lt; locateRanking(scores, newScore) &lt;&lt; std::endl;
    }
}


tl;dr

Sort the vector, remove the duplicates and use a binary search instead of your linear approach and you will discover a huge performance benefit.