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
p00746.html142 linesDownload Raw Back to problem_descriptions
1 2 3<h1><font color="#000000">Problem A:</font> Pablo Squarson's Headache</h1>4 5 6 7<!-- begin en only -->8<p>Pablo Squarson is a well-known cubism artist.  This year's theme for Pablo Squarson is "Squares".  Today we are visiting his studio to see how his masterpieces are given birth.</p>9<!-- end en only -->10 11 12<!-- begin en only -->13<p>At the center of his studio, there is a huuuuuge table and beside it are many, many squares of the same size.  Pablo Squarson puts one of the squares on the table.  Then he places some other squares on the table in sequence.  It seems his methodical nature forces him to place each square side by side to the one that he already placed on, with machine-like precision.</p>14<!-- end en only -->15 16 17<!-- begin en only -->18<p>Oh!  The first piece of artwork is done.  Pablo Squarson seems satisfied with it.  Look at his happy face.</p>19<!-- end en only -->20 21 22<!-- begin en only -->23<p>Oh, what's wrong with Pablo?  He is tearing his hair!  Oh, I see.  He wants to find a box that fits the new piece of work but he has trouble figuring out its size.  Let's help him!</p>24<!-- end en only -->25 26 27<!-- begin en only -->28<p>Your mission is to write a program that takes instructions that record how Pablo made a piece of his artwork and computes its width and height.  It is known that the size of each square is 1.  You may assume that Pablo does not put a square on another.</p>29<!-- end en only -->30 31 32<!-- begin en only -->33<p>I hear someone murmured "A smaller box will do".  No, poor Pablo, shaking his head, is grumbling "My square style does not seem to be understood by illiterates".</p>34<!-- end en only -->35 36<p style="text-align: center">37<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_D2010_A-1">38</p>39 40 41<h3>Input</h3>42 43 44<!-- begin en only -->45<p>The input consists of a number of datasets.  Each dataset represents the way Pablo made a piece of his artwork.  The format of a dataset is as follows.</p>46<!-- end en only -->47 48<blockquote>49<span class="math">N</span><br />50<span class="math">n</span><sub>1</sub> <span class="math">d</span><sub>1</sub><br />51<span class="math">n</span><sub>2</sub> <span class="math">d</span><sub>2</sub><br />52...<br />53<span class="math">n<sub>N</sub></span><sub>-1</sub> <span class="math">d<sub>N</sub></span><sub>-1</sub><br />54</blockquote>55 56 57<!-- begin en only -->58<p>The first line contains the number of squares (= <span class="math">N</span>) used to make the piece of artwork.  The number is a positive integer and is smaller than 200.59<!-- end en only -->60 61 62<!-- begin en only -->63<p>The remaining (<span class="math">N</span>-1) lines in the dataset are square placement instructions.  The line &ldquo;<span class="math">n<sub>i</sub></span> <span class="math">d<sub>i</sub></span>&rdquo; indicates placement of the square numbered <span class="math">i</span> (&le; <span class="math">N</span>-1).  The rules of numbering squares are as follows.  The first square is numbered "zero".  Subsequently placed squares are numbered 1, 2, ..., (<span class="math">N</span>-1).  Note that the input does not give any placement instruction to the first square, which is numbered zero.</p>64 65<p>A square placement instruction for the square numbered <span class="math">i</span>, namely &ldquo;<span class="math">n<sub>i</sub> d<sub>i</sub></span>&rdquo;, directs it to be placed next to the one that is numbered <span class="math">n<sub>i</sub></span>, towards the direction given by <span class="math">d<sub>i</sub></span>, which denotes leftward (= 0), downward (= 1), rightward (= 2), and upward (= 3).</p> 66<!-- end en only -->67 68 69<!-- begin en only -->70<p>For example, pieces of artwork corresponding to the four datasets shown in <b>Sample Input</b> are depicted below. Squares are labeled by their numbers.</p>71<!-- end en only -->72 73<p style="text-align: center">74<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_D2010_A-2">75</p>76 77 78<!-- begin en only -->79<p>The end of the input is indicated by a line that contains a single zero.</p>80<!-- end en only -->81 82 83<h3>Output</h3>84 85 86 87<!-- begin en only -->88<p>For each dataset, output a line that contains the width and the height of the piece of artwork as decimal numbers, separated by a space.  Each line should not contain any other characters.</p>89<!-- end en only -->90 91 92<h3>Sample Input</h3>93 94<pre>951965970 0980 1990 21000 3101121020 01031 01042 01053 11064 11075 11086 21097 21108 21119 311210 3113101140 21151 21162 21173 21182 11195 11206 11217 11228 11230124</pre>125</blockquote>126</pre>127 128 129<h3>Output for the Sample Input</h3>130 131<pre>1321 11333 31344 41355 6136</pre>137 138 139 140 141 142