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
p00740.html111 linesDownload Raw Back to problem_descriptions
1 2<h1><font color="#000000">Problem A:</font> Next Mayor</h1>3 4<p>5One of the oddest traditions of the town of Gameston may be that even6the town mayor of the next term is chosen according to the result of a game.7When the expiration of the term of the mayor approaches, at least8three candidates, including the mayor of the time, play a game of9pebbles, and the winner will be the next mayor.10</p>11 12<p>13The rule of the game of pebbles is as follows.14In what follows, <I>n</I> is the number of participating candidates.15</p>16 17<DL>18<DT>Requisites19<DD>A round table, a bowl, and plenty of pebbles.20<DT>Start of the Game21<DD>22 23A number of pebbles are put into the bowl;24the number is decided by the Administration Commission using25some secret stochastic process.26All the candidates, numbered from 0 to <I>n</I>-1 sit around the round table, 27in a counterclockwise order.  Initially, the bowl is handed to the 28serving mayor at the time, who is numbered 0.29<DT>Game Steps30<DD>31When a candidate is handed the bowl and if any pebbles are in it,32one pebble is taken out of the bowl and is33kept, together with those already at hand, if any.34If no pebbles are left in the bowl, the candidate puts35all the kept pebbles, if any, into the bowl.  Then, in either case, the bowl is36handed to the next candidate to the right.37 38This step is repeated until the winner is decided.39<DT>End of the Game40<DD>41When a candidate takes the last pebble in the bowl, and no other42candidates keep any pebbles, the game ends and that candidate with all43the pebbles is the winner.44</DL>45</p>46 47 48<p>49A math teacher of Gameston High, through his analysis, concluded that this game will always end within a finite number of steps, although the number of required steps can be very large.50</p>51 52 53<h3>Input</h3>54 55 56<p>57The input is a sequence of datasets.  Each dataset is a line58containing two integers <I>n</I> and <I>p</I> separated by a single59space.  The integer <I>n</I> is the number of the candidates including60the current mayor, and the integer <I>p</I> is the total number of the61pebbles initially put in the bowl.  You may assume 3 &le; <I>n</I> &le; 5062and 2 &le; <I>p</I> &le; 50.63</p>64 65<p>66With the settings given in the input datasets, the game will end within 1000000 (one million) steps.67</p>68<p>69The end of the input is indicated by a line70containing two zeros separated by a single space.71</p>72 73 74<h3>Output</h3>75 76<p>77The output should be composed of lines corresponding to input datasets78in the same order, each line of which containing the candidate number79of the winner.80No other characters should appear in the output.81 82</p>83 84 85<h3>Sample Input</h3>86 87<pre>883 2893 3903 509110 299231 329350 29450 50950 096</pre>97 98 99<h3>Output for the Sample Input</h3>100 101<pre>102110301041105510630107110813109</pre>110 111