Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6222235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:16:42+00:00 2026-05-24T08:16:42+00:00

Given a list of scores (e.g. 5, 5, 4, 2, 2, 0), I’m looking

  • 0

Given a list of scores (e.g. 5, 5, 4, 2, 2, 0), I’m looking to return the standard competition rankings (1, 1, 3, 4, 4, 6).

From Wikipedia’s ranking page, here’s a summary of SRC:

Standard competition ranking (“1224” ranking)

In competition ranking, items that compare equal receive the same
ranking number, and then a gap is left in the ranking numbers. The
number of ranking numbers that are left out in this gap is one less
than the number of items that compared equal. Equivalently, each
item’s ranking number is 1 plus the number of items ranked above it.
This ranking strategy is frequently adopted for competitions, as it
means that if two (or more) competitors tie for a position in the
ranking, the position of all those ranked below them is unaffected
(ie, a competitor only comes second if exactly one person scores
better than them, third if exactly two people score better than them,
fourth if exactly three people score better than them, etc).

Thus if A ranks ahead of B and C (which compare equal) which are both
ranked ahead of D, then A gets ranking number 1 (“first”), B gets
ranking number 2 (“joint second”), C also gets ranking number 2
(“joint second”) and D gets ranking number 4 (“fourth”). In this case,
nobody would get ranking number 3 (“third”) and that would be left as
a gap.

Code in any language would be really helpful.

As an aside I’d be interested to see algorithms for the other ranking types (modified competition ranking, dense ranking, ordinal ranking and fractional ranking).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:16:44+00:00Added an answer on May 24, 2026 at 8:16 am

    Here’s how to do it:

    • Set ranking[0] to 1.
    • For each index i in the score-list
      • If score[i] equals score[i-1] they should have same ranknig:
        • ranking[i] = ranknig[i-1]
      • else the ranking should equal the current index:
        • ranking[i] = i + 1
          (+ 1 due to 0-based indecies and 1-based ranking)

    Here’s a sample implementation in Java:

    // Set up some sample scores.
    int[] scores = { 5, 5, 4, 2, 2, 0 };
    
    // Initialize a ranking array
    int[] rankings = new int[scores.length];
    
    // Fill in each position
    rankings[0] = 1;
    for (int i = 1; i < rankings.length; i++)
        rankings[i] = scores[i] == scores[i-1] ? rankings[i-1] : i + 1;
    
    // rankings = [1, 1, 3, 4, 4, 6]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's a really simple question regarding pythonic coding. Given a list, if you want
Given an R list, I wish to find the index of a given list
The original code was somehow complex, i simplify it as: Given: list of class
Given a list a containing vectors of unequal length and a vector b containing
Given a List such as List(1, 2, 3, 4, 5, 6, 7) what is
Given a list like this: num = [1, 2, 3, 4, 5] There are
Given a list of potential ID's is there a quick way using a single
Given a list of elements like so: int[] ia = new int[] { -4,
Given a list of numbers, how does one find differences between every ( i
Given a list A = [1 2 3 4 5 6] Is there any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.