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
p00946.html84 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 9<h2>Problem A10Rearranging a Sequence11</h2>12 13<p>14You are given an ordered sequence of integers, ($1, 2, 3, ..., n$). Then, a number of requests will be given. Each request specifies an integer in the sequence. You need to move the specified integer to the head of the sequence, leaving the order of the rest untouched. Your task is to find the order of the elements in the sequence after following all the requests successively.15</p>16 17<h3>Input</h3>18 19<p>20The input consists of a single test case of the following form.<br/>21<br/>22$n$ $m$<br/>23$e_1$<br/>24...<br/>25$e_m$<br/>26</p>27 28<p>29The integer $n$ is the length of the sequence ($1 \leq n \leq 200000$). The integer $m$ is the number of requests ($1 \leq m \leq 100000$). The following $m$ lines are the requests, namely $e_1, ...,  e_m$, one per line. Each request $e_i$ ($1 \leq i \leq m$) is an integer between 1 and $n$, inclusive, designating the element to move. Note that, the integers designate the integers themselves to move, not their positions in the sequence.30</p>31 32 33<h3>Output</h3>34 35<p>36Output the sequence after processing all the requests. Its elements are to be output, one per line, in the order in the sequence.37</p>38 39 40<h3>Sample Input 1</h3>41 42<pre>5 3434442455</pre>46 47<h3>Sample Output 1</h3>48 49<pre>5502514521533</pre>54 55<br/>56 57<h3>Sample Input 2</h3>58 59<pre>10 86016146276336446510661673</pre>68 69<h3>Sample Output 2</h3>70 71<pre>37217310744757762775786798809</pre>81 82<p>83In Sample Input 1, the initial sequence is (1, 2, 3, 4, 5). The first request is to move the integer 4 to the head, that is, to change the sequence to (4, 1, 2, 3, 5). The next request to move the integer 2 to the head makes the sequence (2, 4, 1, 3, 5). Finally, 5 is moved to the head, resulting in (5, 2, 4, 1, 3).84</p>