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
p00748.html158 linesDownload Raw Back to problem_descriptions
1 2 3 4<h1><font color="#000000">Problem C:</font> Pollock's conjecture</h1>5 6 7<!-- begin en only -->8<p>9The <I>n</I>th triangular number is10defined as11the sum of the first <I>n</I> positive integers.12The <I>n</I>th tetrahedral number is13defined as14the sum of the first <I>n</I> triangular numbers.15It is easy to show that16the <I>n</I>th tetrahedral number is equal to17<I>n</I>(<I>n</I>+1)(<I>n</I>+2)&thinsp;&frasl;&thinsp;6.18For example,19the 5th tetrahedral number is201+(1+2)+(1+2+3)+(1+2+3+4)+(1+2+3+4+5)21= 5&times;6&times;7&thinsp;&frasl;&thinsp;622= 35.23</p>24<!-- end en only -->25 26<dl>27<dt>28<!-- begin en only -->29The first 5 triangular numbers30<!-- end en only -->311, 3, 6, 10, 1532</dt>33<dd>34<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_D2010_C-11" alt="Tr[1]" align="top">35<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_D2010_C-12" alt="Tr[2]" align="top">36<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_D2010_C-13" alt="Tr[3]" align="top">37<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_D2010_C-14" alt="Tr[4]" align="top">38<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_D2010_C-15" alt="Tr[5]" align="top">39</dd>40<dt>41<!-- begin en only -->42The first 5 tetrahedral numbers43<!-- end en only -->441, 4, 10, 20, 3545</dt>46<dd>47<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_D2010_C-1" alt="Tet[1]" align="top">48<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_D2010_C-2" alt="Tet[2]" align="top">49<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_D2010_C-3" alt="Tet[3]" align="top">50<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_D2010_C-4" alt="Tet[4]" align="top">51<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_D2010_C-5" alt="Tet[5]" align="top">52</dd>53</dl>54 55<!-- begin en only -->56<p>57In 1850,58Sir Frederick Pollock, 1st Baronet,59who was not a professional mathematician60but a British lawyer and Tory (currently known as Conservative) politician,61conjectured62that every positive integer can be represented63as the sum of at most five tetrahedral numbers.64Here,65a tetrahedral number may occur in the sum more than once66and,67in such a case, each occurrence is counted separately.68The conjecture has been open for more than one and a half century.69</p>70<!-- end en only -->71 72<!-- begin en only -->73<p>74Your mission is to write a program75to verify Pollock's conjecture for individual integers.76Your program should make a calculation of77the least number of tetrahedral numbers78to represent each input integer as their sum.79In addition,80for some unknown reason,81your program should make a similar calculation82with only odd tetrahedral numbers available.83</p>84<!-- end en only -->85 86<!-- begin en only -->87<p>88For example,89one can represent 40 as the sum of 2 tetrahedral numbers,904&times;5&times;6&thinsp;&frasl;&thinsp;6 + 4&times;5&times;6&thinsp;&frasl;&thinsp;6,91but 40 itself is not a tetrahedral number.92One can represent 40 as the sum of 6 odd tetrahedral numbers,935&times;6&times;7&thinsp;&frasl;&thinsp;6 + 1&times;2&times;3&thinsp;&frasl;&thinsp;6 + 1&times;2&times;3&thinsp;&frasl;&thinsp;6 + 1&times;2&times;3&thinsp;&frasl;&thinsp;6 + 1&times;2&times;3&thinsp;&frasl;&thinsp;6 + 1&times;2&times;3&thinsp;&frasl;&thinsp;6,94but cannot represent as the sum of fewer odd tetrahedral numbers.95Thus, your program should report 2 and 6 if 40 is given.96</p>97<!-- end en only -->98 99 100 101<h3>Input</h3>102 103 104<!-- begin en only -->105<p>106The input is a sequence of lines each of which contains a single positive integer less than 10<sup>6</sup>.107The end of the input is indicated by a line containing a single zero.108</p>109<!-- end en only -->110 111 112 113<h3>Output</h3>114 115<!-- begin en only -->116<p>117For each input positive integer,118output a line containing two integers separated by a space.119The first integer should be120the least number of tetrahedral numbers121to represent the input integer as their sum.122The second integer should be123the least number of odd tetrahedral numbers124to represent the input integer as their sum.125No extra characters should appear in the output.126</p>127<!-- end en only -->128 129 130<h3>Sample Input</h3>131 132<pre>133401341413551361651371201381031391061401391410142</pre>143 144 145<h3>Output for the Sample Input</h3>146 147<pre>1482 61492 141502 51511 11521 181535 351544 41553 37156</pre>157 158