prithivMLmods/Coder-Stat
Coder-Stat Dataset Overview The Coder-Stat dataset is a collection of programming-related data, including problem IDs, programming languages, original statuses, and source code snippets. This dataset is designed to assist in the analysis of coding patterns, error types, and performance metrics. Dataset Details Modalities Tabular: The dataset is structured in a tabular format. Text: Contains text data, including source code snippets.… See the full description on the dataset page: https://huggingface.co/datasets/prithivMLmods/Coder-Stat.
3139
1 2<h1>Patisserie ACM</h1>3<!-- end en only -->4 5 6 7<!-- begin en only -->8<p>9Amber Claes Maes, a patissier, opened her own shop last month.10She decided to submit her work to the International Chocolate11Patissier Competition to promote her shop, and she12was pursuing a recipe of sweet chocolate bars.13After thousands of trials, she finally reached the recipe.14However, the recipe required high skill levels to form chocolate to15an orderly rectangular shape.16Sadly, she has just made another strange-shaped chocolate bar as shown in17Figure G-1.18</p>19<!-- end en only -->20 21<center>22<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_1185_1"><br>23<!-- begin en only -->24<p>Figure G-1: A strange-shaped chocolate bar</p>25<!-- end en only -->26</center>27 28<!-- begin en only -->29<p>30Each chocolate bar consists of many small rectangular segments31of chocolate. 32Adjacent segments are separated with a groove in33between them for ease of snapping.34She planned to cut the strange-shaped chocolate bars into several35rectangular pieces and sell them in her shop.36She wants to cut each chocolate bar as follows.37<ul>38 <li>The bar must be cut along grooves.</li>39 <li>The bar must be cut into rectangular pieces.</li>40 <li>The bar must be cut into as few pieces as possible.</li>41</ul>42Following the rules, Figure G-2 can be an instance of cutting of43the chocolate bar shown in Figure G-1. Figures G-3 and G-444do not meet the rules; Figure G-3 has45a non-rectangular piece, and Figure G-4 has more pieces46than Figure G-2.47</p>48<!-- end en only -->49<br>50 51<center>52<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_1185_2"><br>53<!-- begin en only -->54<p>Figure G-2: An instance of cutting that follows the rules</p>55<!-- end en only -->56<br><br>57</center>58 59<center>60<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_1185_3"><br>61<!-- begin en only -->62<p>Figure G-3: An instance of cutting that leaves a non-rectangular piece</p>63<!-- end en only -->64<br><br>65</center>66 67<center>68<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_1185_4"><br>69<!-- begin en only -->70<p>Figure G-4: An instance of cutting that yields more pieces than Figure G-2</p>71<!-- end en only -->72</center>73 74<!-- begin en only -->75<p>76Your job is to write a program that computes the number of pieces77of chocolate after cutting according to the rules.78</p>79<!-- end en only -->80 81 82<h3>Input</h3>83 84 85<!-- begin en only -->86<p>87The input is a sequence of datasets. The end of the input is indicated by88a line containing two zeros separated by a space. Each dataset is89formatted as follows.90<blockquote>91<i>h</i> <i>w</i><br>92<i>r</i><sub>(1, 1)</sub> ... <i>r</i><sub>(1, <i>w</i>)</sub><br>93<i>r</i><sub>(2, 1)</sub> ... <i>r</i><sub>(2, <i>w</i>)</sub><br>94...<br>95<i>r</i><sub>(<i>h</i>, 1)</sub> ... <i>r</i><sub>(<i>h</i>, <i>w</i>)</sub><br>96</blockquote>97The integers <i>h</i> and <i>w</i> are the lengths of the two orthogonal98dimensions of the chocolate, in number of segments.99You may assume that 2 ≤ <i>h</i> ≤ 100 and 2 ≤ <i>w</i> ≤ 100.100Each of the following <i>h</i>101lines consists of <i>w</i> characters, each is either a102"<t>.</t>" or a "<t>#</t>". The character103<i>r</i><sub>(<i>i</i>, <i>j</i>)</sub> represents whether 104the chocolate segment exists at the position (<i>i</i>, <i>j</i> )105as follows.106<ul>107 <li>"<t>.</t>": There is no chocolate.</li>108 <li>"<t>#</t>": There is a segment of chocolate.</li>109</ul>110You can assume that there is no dataset that represents111either multiple disconnected bars as depicted in Figure G-5112or a bar in a shape with hole(s) as depicted in Figure G-6113and G-7. You can also assume that there is at least one "<t>#</t>"114character in each dataset.115</p>116<!-- end en only -->117 118<center>119<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_1185_5"><br>120<!-- begin en only -->121<p>Figure G-5: Disconnected chocolate bars</p>122<!-- end en only -->123<br><br>124</center>125 126<center>127<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_1185_6"><br>128<!-- begin en only -->129<p>Figure G-6: A chocolate bar with a hole</p>130<!-- end en only -->131<br><br>132</center>133 134<center>135<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_1185_7"><br>136<!-- begin en only -->137<p>Figure G-7: Another instance of a chocolate bar with a hole</p>138<!-- end en only -->139</center>140 141 142 143<h3>Output</h3>144 145<!-- begin en only -->146<p>147For each dataset, output a line containing the integer representing148the number of chocolate pieces obtained by cutting according to the rules.149No other characters are allowed in the output.150</p>151<!-- end en only -->152 153 154<h3>Sample Input</h3>155 156<pre>1573 5158###.#159#####160###..1614 5162.#.##163.####164####.165##.#.1668 8167.#.#.#.#168########169.######.170########171.######.172########173.######.174########1758 8176.#.#.#.#177########178.##.#.#.179##....##180.##.###.181##...###182.##.###.183###.#.##1844 4185####186####187####188####1890 0190</pre>191 192 193<h3>Output for the Sample Input</h3>194 195<pre>1963197519811199192001201</pre>