{"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":"dab10a94-73e2-5711-b5ff-4768f461e4bc","task_key":"ICPC~2dWorld~2dFinals--examples--2012~5fK","task_revision_id":"3","upstream_id":"2012_K","short_description":"Stacking Plates","config":"ICPC-World-Finals","split":"examples","body":"{\"platform\":\"atcoder\",\"question_content\":\"# Problem Statement\\n\\nThe Plate Shipping Company is an Internet retailer that, as their name suggests, exclusively sells plates. They pride themselves in offering the widest selection of dinner plates in the universe from a large number of manufacturers.\\n\\nIn a recent cost analysis, the company has discovered that they spend a large amount of money on packing the plates for shipment. Part of the reason is that plates have to be stacked before being put into shipping containers. Apparently, this is taking more time than expected. Maybe you can help.\\n\\nA shipment of plates consists of plates from several manufacturers. The plates from each manufacturer come stacked, that is, each arranged in a single stack with plates ordered by size (the smallest at the top, the largest at the bottom). We will call such a stack **properly ordered**. To ship all these plates, you must combine them into a single stack, again properly ordered.\\n\\nTo join the manufacturers’ stacks into a single stack, two kinds of operations are allowed:\\n- **Split**: A single stack can be split into two stacks by lifting any top portion of the stack and putting it aside to form a new stack.\\n- **Join**: Two stacks can be joined by putting one on top of the other. This is allowed only if the bottom plate of the top stack is no larger than the top plate of the bottom stack, that is, the joined stack has to be properly ordered.\\n\\nNote that a portion of any stack may never be put directly on top of another stack. It must first be split and then the split portion must be joined with the other stack. Given a collection of stacks, you have to find the minimum number of operations that transforms them into a single stack.\\n\\n## Input\\n\\nEach test case starts with a line containing a single integer \\\\( n \\\\) (1 ≤ \\\\( n \\\\) ≤ 50), the number of stacks that have to be combined for a shipment. This is followed by \\\\( n \\\\) lines, each describing a stack. These lines start with an integer \\\\( h \\\\) (1 ≤ \\\\( h \\\\) ≤ 50), the height of the stack. This number is followed by \\\\( h \\\\) positive integers that give the diameters of the plates, from top to bottom. All diameters are at most 10,000. These numbers will be in non-decreasing order.\\n\\n## Output\\n\\nFor each test case, display the case number and the minimum number of operations (splits and joins) that have to be performed to combine the given stacks into a single stack.\\n\\n## Sample Input\\n\\n```\\n2\\n3 1 2 4\\n2 3 5\\n```\\n\\n## Sample Output\\n\\n```\\nCase 1: 5\\n```\\n\\n## Sample Input\\n\\n```\\n3\\n4 1 1 1 1\\n4 1 1 1 1\\n4 1 1 1 1\\n```\\n\\n## Sample Output\\n\\n```\\nCase 2: 2\\n```\",\"question_title\":\"Stacking Plates\"}","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":[]}