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 B:</font> Analyzing Login/Logout Records</h1>3<!-- end en only -->4 5 6 7<p>8You have a computer literacy course in your university. In the computer9system, the login/logout records of all PCs in a day are stored in a10file. Although students may use two or more PCs at a time, no one can11log in to a PC which has been logged in by someone who has not12logged out of that PC yet.13 14</p>15<!-- end en only -->16 17<!-- begin en only -->18<p>19You are asked to write a program that calculates the total time of a20student that he/she used at least one PC in a given time period21(probably in a laboratory class) based on the records in the file.22</p>23<!-- end en only -->24 25<!-- begin en only -->26<p>27 The following are example login/logout records.28<ul>29<li> The student 1 logged in to the PC 1 at 12:5530<li> The student 2 logged in to the PC 4 at 13:0031<li> The student 1 logged in to the PC 2 at 13:1032<li> The student 1 logged out of the PC 2 at 13:2033<li> The student 1 logged in to the PC 3 at 13:3034<li> The student 1 logged out of the PC 1 at 13:4035<li> The student 1 logged out of the PC 3 at 13:4536<li> The student 1 logged in to the PC 1 at 14:2037<li> The student 2 logged out of the PC 4 at 14:3038<li> The student 1 logged out of the PC 1 at 14:4039</ul>40<p>41For a query such as "Give usage of the student 1 between 13:00 and4214:30", your program should answer "55 minutes", that is, the sum of4345 minutes from 13:00 to 13:45 and 10 minutes from 14:20 to 14:30, as44depicted in the following figure.45</p>46<!-- end en only -->47 48<p align="center">49<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_b"><br>50</p>51 52 53<h2>Input</h2>54 55<!-- begin en only -->56<p>57The input is a sequence of a number of datasets.58The end of the input is indicated by a line containing two zeros59separated by a space.60The number of datasets never exceeds 10.61</p>62<!-- end en only -->63 64<!-- begin en only -->65<p>66Each dataset is formatted as follows.67<blockquote>68<i>N</i> <i>M</i> <br>69<i>r</i> <br>70record<sub>1</sub><br>71... <br>72record<sub><i>r</i> </sub><br>73<i>q</i> <br> 74query<sub>1</sub><br>75... <br>76query<sub><i>q</i> </sub><br>77</blockquote>78</p>79<!-- end en only -->80 81 82<p>83<!-- begin en only -->84The numbers <i>N</i> and <i>M</i> in the first line are the numbers of85PCs and the students, respectively. <i>r</i> is the number of86records. <i>q</i> is the number of queries. These four are integers87satisfying the following.88<!-- end en only -->89<blockquote>901 ≤ <i>N</i> ≤ 1000, 1 ≤ <i>M</i> ≤ 10000, 2 ≤ <i>r</i> ≤ 1000, 1 ≤ <i>q</i> ≤ 5091</blockquote>92</p>93 94<!-- begin en only -->95<p>96Each record consists of four integers, delimited by a space, as follows.97</p>98<!-- end en only -->99<blockquote>100<i>t</i> <i>n</i> <i>m</i> <i>s</i> 101</blockquote>102<p>103<!-- begin en only -->104<i>s</i> is 0 or 1.105If <i>s</i> is 1, this line means that the student <i>m</i> logged in106to the PC <i>n</i> at time <i>t</i> . If <i>s</i> is 0, it means that107the student <i>m</i> logged out of the PC <i>n</i> at time <i>t</i> .108The time is expressed as elapsed minutes from 0:00 of the day.109<i>t</i> , <i>n</i> and <i>m</i> satisfy the following.110<!-- end en only -->111<blockquote>112540 ≤ <i>t</i> ≤ 1260,1131 ≤ <i>n</i> ≤ <i>N</i> , 1 ≤ <i>m</i> ≤ <i>M</i> 114</blockquote>115 116<p>117<!-- begin en only -->118You may assume the following about the records.119<nl>120 <li>Records are stored in ascending order of time <i>t.</i> 121 <li>No two records for the same PC has the same time <i>t.</i> 122 <li>No PCs are being logged in before the time of the first record123 nor after that of the last record in the file.124 <li>Login and logout records for one PC appear alternatingly, and each of the login-logout record pairs is for the same student.125</nl>126<!-- end en only -->127</p>128 129<!-- begin en only -->130<p>131Each query consists of three integers delimited by a space, as follows.132</p>133<!-- end en only -->134 135<blockquote>136<i>t<sub>s</sub></i> <i>t<sub>e</sub></i> <i>m</i> 137</blockquote>138 139<p>140<!-- begin en only -->141It represents "Usage of the student <i>m</i> between 142<i>t<sub>s</sub></i> and <i>t<sub>e</sub></i> ".143<i>t<sub>s</sub></i> , <i>t<sub>e</sub></i> and <i>m</i> 144satisfy the following.145<!-- end en only -->146<blockquote>147540 ≤ <i>t<sub>s</sub></i> < <i>t<sub>e</sub></i> ≤ 1260,1481 ≤ <i>m</i> ≤ <i>M</i> 149</blockquote>150 151 152<h2>Output</h2>153 154<!-- begin en only -->155<p>156For each query, print a line having a decimal integer indicating the157time of usage in minutes. Output lines should not have any character158other than this number.159</p>160<!-- end en only -->161 162<h2>Sample Input</h2>163 164<pre>1654 216610167775 1 1 1168780 4 2 1169790 2 1 1170800 2 1 0171810 3 1 1172820 1 1 0173825 3 1 0174860 1 1 1175870 4 2 0176880 1 1 01771178780 870 117913 1518012181540 12 13 1182600 12 13 0183650 13 15 1184660 12 15 1185665 11 13 1186670 13 15 0187675 11 13 0188680 12 15 01891000 11 14 11901060 12 14 11911060 11 14 01921080 12 14 01933194540 700 13195600 1000 151961000 1200 111971 11982199600 1 1 1200700 1 1 02015202540 600 1203550 650 1204610 620 1205650 750 1206700 800 12070 0208</pre>209 210 211<h2>Output for the Sample Input</h2>212 213<pre>214552157021630217021802195022010221502220223</pre>224 