{"kind":"task","effective_mode":"full","benchmark":{"kind":"benchmark","effective_mode":"full","slug":"hlce","formal_name":"Humanity's Last Code Exam","introduction":"Humanity's Last Code Exam evaluates problem solving and code generation using ICPC World Finals and IOI problems. The project describes 235 problems; this import selects its public ICPC dataset of 146 problems.","introduction_ja":"","introduction_en":"","category":"Category not supplied","task_count":null,"acquisition_status":"Acquisition status not supplied","official_url":"https://humanity-s-last-code-exam.github.io/website/","indexing_mode":"noindex","profile":{"resources":[],"task_format":"","scoring":"","metric":"","size":"","answer_access":"","license":"","citation":"","maintainer":"","released":"","why_hard":"","related":[]}},"task_id":"be5a8853-9604-5400-b45f-d2ad78fe467f","task_key":"ICPC~2dWorld~2dFinals--examples--2017~5fK","task_revision_id":"3","upstream_id":"2017_K","short_description":"Tarot Sham Boast","config":"ICPC-World-Finals","split":"examples","body":"{\"platform\":\"atcoder\",\"question_content\":\"## Problem Description\\n\\nCurse your rival! Every year at the annual Rock Paper Scissors tournament, you have made it to the final match. (Your Rock technique is unmatched, and your Paper cuts to the bone! Your Scissors need a little work, though.) But every year, he defeats you, even though his moves appear entirely random! And he claims to the press that he simply cannot be beaten. What is his secret?\\n\\nFortunately, you think you have figured it out. This year, just before the tournament, you caught him visiting various shamans around town. Aha! He is using the supernatural against you! You figured two can play at this game. So you went and visited a set of fortune-tellers, who have each used a Tarot deck to predict a sequence that your rival will end up using, sometime during the match.\\n\\nHowever, your initial excitement has passed, and now you are feeling a little silly. This cannot possibly work, right? In the end it feels like you have paid good money for a fraudulent, random set of predictions. Oh well; you might as well keep an eye out for some of them during the match. But which predictions will you use?\\n\\nIn the final match, you and your rival will play \\\\( n \\\\) rounds of Rock Paper Scissors. In each round, your rival and you will both choose one of the three options (Rock, Paper, or Scissors). Based on your selections, a winner of the round will be determined (exactly how is irrelevant to this problem).\\n\\nGiven the length of the final match and the various predictions, sort them in order of how likely they are to appear sometime during the match as a contiguous sequence of options chosen by your rival, assuming he is choosing his symbol in each round independently and uniformly at random.\\n\\n## Input\\n\\nThe first line of input contains two integers \\\\( n \\\\) (\\\\( 1 \\\\leq n \\\\leq 10^6 \\\\)), the number of rounds in the final match, and \\\\( s \\\\) (\\\\( 1 \\\\leq s \\\\leq 10 \\\\)), the number of sequences. The remaining \\\\( s \\\\) lines each describe a prediction, consisting of a string of characters ‘R’, ‘P’, and ‘S’. All predictions have the same length, which is between 1 and \\\\( n \\\\) characters long, inclusive, and no longer than \\\\( 10^5 \\\\).\\n\\n## Output\\n\\nDisplay all of the predictions, sorted by decreasing likelihood of appearance sometime during the final match. In the case of tied predictions, display them in the same order as in the input.\\n\\n## Sample Input 1\\n\\n```\\n3 4\\nPP\\nRR\\nPS\\nSS\\n```\\n\\n## Sample Output 1\\n\\n```\\nPS\\nPP\\nRR\\nSS\\n```\\n\\n## Sample Input 2\\n\\n```\\n20 3\\nPRSPS\\nSSSSS\\nPPSPP\\n```\\n\\n## Sample Output 2\\n\\n```\\nPRSPS\\nPPSPP\\nSSSSS\\n```\",\"question_title\":\"Tarot Sham Boast\"}","display_format":"text","language":"","answer_status":"published","assets":[],"source_url":"https://humanity-s-last-code-exam.github.io/website/","history":"initial import","indexing_mode":"noindex","subproblems":[],"grids":[]}