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 2<H1><font color="#000">Problem H: </font>Company Organization</H1>3 4<p>5You started a company a few years ago and fortunately it has been highly successful. As the growth of the company, you noticed that you need to manage employees in a more organized way, and decided to form several groups and assign employees to them.6</p>7 8<p>9Now, you are planning to form n groups, each of which corresponds to a project in the company. Sometimes you have constraints on members in groups. For example, a group must be a subset of another group because the former group will consist of senior members of the latter group, the members in two groups must be the same because current activities of the two projects are closely related, the members in two groups must not be exactly the same to avoid corruption, two groups cannot have a common employee because of a security reason, and two groups must have a common employee to facilitate collaboration.10</p>11 12<p>13In summary, by letting <i>X<sub>i</sub></i> (<i>i</i> = 1, ... , <i>n</i>) be the set of employees assigned to the <i>i</i>-th group, we have five types of constraints as follows.14</p>15 16<ol>17<li> <i>X<sub>i</sub></i> ⊆ <i>X<sub>j</sub></i></li>18<li> <i>X<sub>i</sub></i> = <i>X<sub>j</sub></i></li>19<li> <i>X<sub>i</sub></i> ≠ <i>X<sub>j</sub></i></li>20<li> <i>X<sub>i</sub></i> ∩ <i>X<sub>j</sub></i> = ∅</li>21<li> <i>X<sub>i</sub></i> ∩ <i>X<sub>j</sub></i> ≠ ∅</li>22</ol>23 24<p>25Since you have listed up constraints without considering consistency, it might be the case that you cannot satisfy all the constraints. Constraints are thus ordered according to their priorities, and you now want to know how many constraints of the highest priority can be satisfied.26</p>27 28<p>29You do not have to take ability of employees into consideration. That is, you can assign anyone to any group. Also, you can form groups with no employee. Furthermore, you can hire or fire as many employees as you want if you can satisfy more constraints by doing so.30</p>31 32<p>33For example, suppose that we have the following five constraints on three groups in the order of their priorities, corresponding to the first dataset in the sample input.34</p>35 36<ul>37<li><i>X</i><sub>2</sub> ⊆ <i>X</i><sub>1</sub></li>38<li><i>X</i><sub>3</sub> ⊆ <i>X</i><sub>2</sub></li>39<li><i>X</i><sub>1</sub> ⊆ <i>X</i><sub>3</sub></li>40<li><i>X</i><sub>1</sub> ≠ <i>X</i><sub>3</sub></li>41<li><i>X</i><sub>3</sub> ⊆ <i>X</i><sub>1</sub></li>42</ul>43 44<p>45By assigning the same set of employees to <i>X</i><sub>1</sub>, <i>X</i><sub>2</sub>, and <i>X</i><sub>3</sub>, we can satisfy the first three constraints. However, no matter how we assign employees to <i>X</i><sub>1</sub>, <i>X</i><sub>2</sub>, and <i>X</i><sub>3</sub>, we cannot satisfy the first four highest priority constraints at the same time. Though we can satisfy the first three constraints and the fifth constraint at the same time, the answer should be three.46</p>47 48<H2>Input</H2>49 50<p>51The input consists of several datasets. The first line of a dataset consists of two integers <i>n</i> (2 ≤ <i>n</i> ≤ 100) and <i>m</i> (1 ≤ <i>m</i> ≤ 10000), which indicate the number of groups and the number of constraints, respectively. Then, description of <i>m</i> constraints follows. The description of each constraint consists of three integers <i>s</i> (1 ≤ <i>s</i> ≤ 5), <i>i</i> (1 ≤ <i>i</i> ≤ <i>n</i>), and <i>j</i> (1 ≤ <i>j</i> ≤ <i>n</i>, <i>j</i> ≠= <i>i</i>), meaning a constraint of the <i>s</i>-th type imposed on the <i>i</i>-th group and the <i>j</i>-th group. The type number of a constraint is as listed above. The constraints are given in the descending order of priority.52</p>53 54<p>55The input ends with a line containing two zeros.56</p>57 58 59<H2>Output</H2>60 61<p>62For each dataset, output the number of constraints of the highest priority satisfiable at the same time.63</p>64 65<H2>Sample Input</H2>66<pre>674 5681 2 1691 3 2701 1 3713 1 3721 3 1734 4741 2 1751 3 2761 1 3774 1 3784 5791 2 1801 3 2811 1 3824 1 3835 1 3842 3851 1 2862 1 2873 1 2880 089</pre>90 91<H2>Output for the Sample Input</H2>92<pre>93394495496297</pre>