Team Ai
Datasetpublic

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.

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
3likes139downloads
p00899.html41 linesDownload Raw Back to problem_descriptions
1 2<H1><font color="#000">Problem F: </font>City Merger</H1>3 4<p>5Recent improvements in information and communication technology have made it possible to provide municipal service to a wider area more quickly and with less costs. Stimulated by this, and probably for saving their not sufficient funds, mayors of many cities started to discuss on mergers of their cities.6</p>7 8<p>9There are, of course, many obstacles to actually put the planned mergers in practice. Each city has its own culture of which citizens are proud. One of the largest sources of friction is with the name of the new city. All citizens would insist that the name of the new city should have the original name of their own city at least as a part of it. Simply concatenating all the original names would, however, make the name too long for everyday use.10</p>11 12<p>13You are asked by a group of mayors to write a program that finds the shortest possible name for the new city that includes all the original names of the merged cities. If two or more cities have common parts, they can be overlapped. For example, if &quot;FUKUOKA&quot;, &quot;OKAYAMA&quot;, and &quot;YAMAGUCHI&quot; cities are to be merged, &quot;FUKUOKAYAMAGUCHI&quot; is such a name that include all three of the original city names. Although this includes all the characters of the city name &quot;FUKUYAMA&quot; in this order, it does not appear as a consecutive substring, and thus &quot;FUKUYAMA&quot; is not considered to be included in the name.14</p>15 16<H2>Input</H2>17 18<p>19The input is a sequence of datasets. Each dataset begins with a line containing a positive integer <i>n</i> (<i>n</i> &le; 14), which denotes the number of cities to be merged. The following <i>n</i> lines contain the names of the cities in uppercase alphabetical letters, one in each line. You may assume that none of the original city names has more than 20 characters. Of course, no two cities have the same name.20</p>21 22<p>23The end of the input is indicated by a line consisting of a zero.24</p>25 26<H2>Output</H2>27 28<p>29For each dataset, output the length of the shortest possible name of the new city in one line. The output should not contain any other characters.30</p>31 32<H2>Sample Input</H2>33<pre>343<br>FUKUOKA<br>OKAYAMA<br>YAMAGUCHI<br>3<br>FUKUOKA<br>FUKUYAMA<br>OKAYAMA<br>2<br>ABCDE<br>EDCBA<br>4<br>GA<br>DEFG<br>CDDE<br>ABCD<br>2<br>ABCDE<br>C<br>14<br>AAAAA<br>BBBBB<br>CCCCC<br>DDDDD<br>EEEEE<br>FFFFF<br>GGGGG<br>HHHHH<br>IIIII<br>JJJJJ<br>KKKKK<br>LLLLL<br>MMMMM<br>NNNNN<br>035</pre>36 37<H2>Output for the Sample Input</H2>38 39<pre>4016<br>19<br>9<br>9<br>5<br>7041</pre>