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
p00932.html127 linesDownload Raw Back to problem_descriptions
1 2<script type="text/x-mathjax-config">3  MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});4</script>5<script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>6</script>7 8<h2>Problem I:9Sweet War10</h2>11 12<p>13  There are two countries, Imperial Cacao and Principality of Cocoa. Two girls, Alice (the Empress of Cacao) and Brianna (the Princess of Cocoa) are friends and both of them love chocolate very much.14</p>15 16<p>17One day, Alice found a transparent tube filled with chocolate balls (Figure I.1). The tube has only one opening at its top end. The tube is narrow, and the chocolate balls are put in a line. Chocolate balls are identified by integers 1, 2, . . ., $N$ where $N$ is the number of chocolate balls. Chocolate ball 1 is at the top and is next to the opening of the tube. Chocolate ball 2 is next to chocolate ball 1, . . ., and chocolate ball $N$ is at the bottom end of the tube. The chocolate balls can be only taken out from the opening, and therefore the chocolate balls must be taken out in the increasing order of their numbers.18</p>19 20<center>21<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ICPCAsia2014_I1" width="360"><br>22<p>Figure I.1. Transparent tube filled with chocolate balls</p>23</center>24 25<p>26Alice visited Brianna to share the tube and eat the chocolate balls together. They looked at the chocolate balls carefully, and estimated that the $nutrition value$ and the $deliciousness$ of chocolate ball $i$ are $r_i$ and $s_i$, respectively. Here, each of the girls wants to maximize the sum of the deliciousness of chocolate balls that she would eat. They are sufficiently wise to resolve this27conflict peacefully, so they have decided to play a game, and eat the chocolate balls according to the rule of the game as follows:28</p>29 30<ol>31<li> Alice and Brianna have initial energy levels, denoted by nonnegative integers $A$ and $B$, respectively.</li>32<li> Alice and Brianna takes one of the following two actions in turn:33  <ul>34    <li> <b>Pass</b>: she does not eat any chocolate balls. She gets a little hungry $-$ specifically, her energy level is decreased by 1. She cannot pass when her energy level is 0.</li>35 36    <li><b>Eat</b>: she eats the topmost chocolate ball $-$ let this chocolate ball $i$ (that is, the chocolate ball with the smallest number at that time). Her energy level is increased by $r_i$, the nutrition value of chocolate ball $i$ (and NOT decreased by 1). Of course, chocolate ball $i$ is removed from the tube.37    </li>38  </ul>39<li> Alice takes her turn first.</li>40<li> The game ends when all chocolate balls are eaten.</li>41</ol>42 43<p>44  You are a member of the staff serving for Empress Alice. Your task is to calculate the sums of deliciousness that each of Alice and Brianna can gain, when both of them play optimally.45</p>46 47 48<h3>Input</h3>49 50<p>51The input consists of a single test case. The test case is formatted as follows.52  <br>53  <br>54 55$N$ $A$ $B$<br>56$r_1$ $s_1$<br>57$r_2$ $s_2$<br>58.<br>59.<br>60.<br>61$r_N$ $s_N$<br><br>62 63  The first line contains three integers, $N$, $A$ and $B$. $N$ represents the number of chocolate balls. $A$ and $B$ represent the initial energy levels of Alice and Brianna, respectively. The following $N$ lines describe the chocolate balls in the tube. The chocolate balls are numbered from 1 to $N$, and each of the lines contains two integers, $r_i$ and $s_i$ for $1 \leq i \leq N$. $r_i$ and $s_i$ represent the nutrition value and the deliciousness of chocolate ball $i$, respectively. The input satisfies64</p>65 66<ul>67<li> $1 \leq N \leq 150$,</li>68<li> $0 \leq A, B, r_i \leq 10^9$,</li>69<li> $0 \leq s_i$, and</li>70<li> $\sum^N_{i=1} s_i \leq 150$</li>71</ul>72 73 74<h3>Output</h3>75 76<p>77Output two integers that represent the total deliciousness that Alice and Brianna can obtain when they play optimally78</p>79 80 81 82<h3>Sample Input 1</h3>83 84<pre>2 5 4855 7864 8</pre>87 88<h3>Sample Output 1</h3>89 90<pre>8 7</pre>91 92<h3>Sample Input 2</h3>93 94<pre>3 50 19549 1960 10970 1</pre>98 99<h3>Sample Output 2</h3>100 101<pre>10 2</pre>102 103<h3>Sample Input 3</h3>104 105<pre>4 3 21061 51072 4610892 401091 31</pre>110 111<h3>Sample Output 3</h3>112 113<pre>77 45</pre>114 115<h3>Sample Input 4</h3>116 117<pre>5 2 511856 211922 731202 21211 5512214 18</pre>123 124<h3>Sample Output 4</h3>125 126<pre>57 93</pre>127