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<!--<H1>Network Charging System</H1>-->2<h1>Charging System for Network</h1>3 4<p>5 There is a network consisting of <var>N</var> machines (sequentially numbered from 0 to <var>N</var>-1) interconnected through <var>N</var>-1 bidirectional communication cables. Any two machines can perform bidirectional communication through one or more cables. From time to time, machines in the network are renewed. When a new machine is introduced, the cables directly connected to it are also replaced with thicker ones to cope with the increased volume of communication traffic.6</p>7 8<p>9 The communication fee arising from communication traffic between any two machines is calculated by summing the charges assigned to all the cables routing via the two. A unique charging scheme is employed in this system: if the size of a cable is a multiple of <var>K</var>, then the cable is not charged (free of charge). Other cables are charged according to their sizes.10</p>11 12<p>13 Based on the given information on the network topology and <var>Q</var> instructions, write a program to execute each instruction.14</p>15 16<ul>17 18 19 20<li>Increase the sizes of all cables directly connected to the machine <var>x</var> by <var>d</var>.</li>21<li>Report the communication charge between the machines <var>s</var> and <var>t</var>.</li>22</ul>23 24 25<h2>Input</h2>26 27<p>28 The input is given in the following format.29</p>30 31<pre>32<var>N</var> <var>K</var>33<var>a_1</var> <var>b_1</var> <var>c_1</var>34<var>a_2</var> <var>b_2</var> <var>c_2</var>35:36<var>a_{N−1}</var> <var>b_{N−1}</var> <var>c_{N−1}</var>37<var>Q</var>38<var>query_1</var>39<var>query_2</var>40:41<var>query_Q</var>42</pre>43 44<p>45The first line provides the number of machines <var>N</var> (2 ≤ <var>N</var> ≤ 10<sup>5</sup>) and the cable size <var>K</var> (1 ≤ <var>K</var> ≤ 10<sup>5</sup>) (the reference value for determining free of charge cables). Each of subsequent <var>N</var>-1 lines provides the <var>i</var>-th cable information that directly connects two machines <var>a_i</var> and <var>b_i</var> (0 ≤ <var>a_i</var> < <var>b_i</var> ≤ <var>N</var>-1), followed by the cable’s initial size <var>c_i</var> (1 ≤ <var>c_i</var> ≤ 10<sup>5</sup>). For any pair of machines, the number of cables directly connecting them is either one or zero. The next line following them provides the number of instructions <var>Q</var> (1 ≤ <var>Q</var> ≤ 10<sup>5</sup>). Each of the Q lines following it provides the <var>i</var>-th instruction <var>query_i</var>, which is either one of the following two:46</p>47 48<pre>49add <var>x</var> <var>d</var>50</pre>51 52<p>53or54</p>55 56<pre>57send <var>s</var> <var>t</var>58</pre>59 60<p>61 The instruction <span>add</span> <var>x</var> <var>d</var> increase the size of all cables directly connected to machine <var>x</var> (0 ≤ <var>x</var> ≤ <var>N</var>-1) by <var>d</var> (1 ≤ <var>d</var> ≤ 10<sup>5</sup>).62</p>63 64<p>65The instruction <span>send</span> <var>s</var> <var>t</var> reports the charge imposed to the communication between the two machines <var>s</var> (0 ≤ <var>s</var> ≤ <var>N</var>-1) and <var>t</var> (0 ≤ <var>t</var> ≤ <var>N</var>-1), where <var>s ≠ t</var>.66 67</p>68 69<p>70 At least one <span>send</span> instruction is included in the input information.71</p>72 73<h2>Output</h2>74 75<p>76 For each <span>send</span> command, output the communication charge between <var>s</var> and <var>t</var>.77</p>78 79<h2>Sample Input 1</h2>80 81<pre>826 3830 1 1840 2 1850 3 1862 4 1872 5 188389send 1 490add 2 291send 1 492</pre>93 94<h2>Sample Output 1</h2>95<pre>96397198</pre>99 