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
p00854.html93 linesDownload Raw Back to problem_descriptions
1 2<H1><font color="#000">Problem A:</font> And Then There Was One</H1>3 4<p>5Let’s play a stone removing game.6</p>7 8<p>9Initially, <i>n</i> stones are arranged on a circle and numbered 1, ... , <i>n</i> clockwise (Figure 1). You are also given two numbers <i>k</i> and <i>m</i>. From this state, remove stones one by one following the rules explained below, until only one remains. In step 1, remove stone <i>m</i>. In step 2, locate the <i>k</i>-th next stone clockwise from <i>m</i> and remove it. In subsequent steps, start from the slot of the stone removed in the last step, make <i>k</i> hops clockwise on the remaining stones and remove the one you reach. In other words, skip (<i>k</i> - 1) remaining stones clockwise and remove the next one. Repeat this until only one stone is left and answer its number.10</p>11<p>12For example, the answer for the case <i>n</i> = 8, <i>k</i> = 5, <i>m</i> = 3 is 1, as shown in Figure 1.13</p>14 15<center>16<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_andThenThereWasOne">17<p>18Figure 1: An example game19</p>20</center>21 22<p>23<b>Initial state</b>: Eight stones are arranged on a circle.24</p>25<p>26<b>Step 1</b>: Stone 3 is removed since <i>m</i> = 3.27</p>28<p>29<b>Step 2</b>: You start from the slot that was occupied by stone 3. You skip four stones 4, 5, 6 and 7 (since <i>k</i> = 5), and remove the next one, which is 8.30</p>31 32<p>33<b>Step 3</b>: You skip stones 1, 2, 4 and 5, and thus remove 6. Note that you only count stones that are still on the circle and ignore those already removed. Stone 3 is ignored in this case.34</p>35 36<p>37<b>Steps 4-7</b>: You continue until only one stone is left. Notice that in later steps when only a few stones remain, the same stone may be skipped multiple times. For example, stones 1 and 4 are skipped twice in step 7.38</p>39 40<p>41<b>Final State</b>: Finally, only one stone, 1, is on the circle. This is the final state, so the answer is 1.42</p>43 44 45 46<H2>Input</H2>47 48<p>49The input consists of multiple datasets each of which is formatted as follows.50</p>51 52<pre>53<i>n k m</i>54</pre>55 56<p>57The last dataset is followed by a line containing three zeros. Numbers in a line are separated by a single space. A dataset satisfies the following conditions.58</p>59<center>60<p>61                         2 &le; <i>n</i> &le; 10000,    1 &le; <i>k</i> &le; 10000,    1 &le; <i>m</i> &le; <i>n</i>62</p>63</center>64 65<p>66The number of datasets is less than 100.67</p>68 69<H2>Output</H2>70 71<p>72For each dataset, output a line containing the stone number left in the final state. No extra characters such as spaces should appear in the output.73</p>74 75<H2>Sample Input</H2>76<pre>778 5 378100 9999 987910000 10000 10000800 0 081</pre>82 83<H2>Output for the Sample Input</H2>84<pre>851869387201988</pre>89 90 91 92 93