title: Generate standard competition rankings from a list of scores
body: <p>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).</p>
  
  <p>From <a href="http://en.wikipedia.org/wiki/Ranking" rel="nofollow">Wikipedia's ranking page</a>, here's a summary of SRC:</p>
  
  <blockquote>
    <p><strong>Standard competition ranking ("1224" ranking)</strong></p>
    
    <p>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).</p>
    
    <p>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.</p>
  </blockquote>
  
  <p>Code in any language would be really helpful.</p>
  
  <p>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).</p>