Editorial for ICPC NEERC 2010 H - Hands of Poker


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
  • The only relevant information for ranking is the list of card ranks (in descending order) and a flag of whether it is a flush or not.
  • Generate all possible representations in the above form (there are 7462 of those):
    • Each rank can occur at most 4 times
    • If any rank occurs more than once, it cannot be a flush
  • Sort representations per problem statement
  • Read hand, determine its representation, and find its place in a previously sorted array of representations

Comments

There are no comments at the moment.