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 3 4<script type="text/x-mathjax-config">5 MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});6</script>7<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">8</script>9 10 11<H1>実数既約分数化</H1>12 13<p>14 実数のうち、小数部が循環するものと有限桁のものは分数として表すことができます。15</p>16 17<br/>18 19<p>20分数で表すことができる実数が与えられたとき、その実数と等しい既約分数(それ以上約分できない分数)を出力するプログラムを作成せよ。21</p>22 23 24<h2>Input</h2>25 26<p>27 入力は以下の形式で与えられる。28</p>29 30<pre>31<var>str</var>32</pre>33 34<p>35 1行に、変換したい実数を表す文字列 <var>str</var> が与えられる。実数の値は 0 より大きい。文字列は数字か「.」、「(」、「)」を含む、長さが 3 以上 8 以下の文字列である。「.」は小数点、「(」は数字の循環の始まり、「)」は数字の循環の終わりを示す。整数部にも小数部にも、必ず1桁以上の数字が与えられるとする。ただし、循環小数が与えられた場合、文字列は以下の条件を満たす。36</p>37<ul>38<li> 循環の始まりと終わりのペアは、小数点の右側に一度だけ現れる。 </li>39<li> 循環の終わりを示す「)」は、文字列の末尾に現れる。</li>40<li> 循環の始まりと終わりの間には、必ず1桁以上の数字が与えられる。</li>41</ul>42 43<h2>Output</h2>44 45<p>46実数を既約分数で表した形式(分子の整数に続けて「/」区切りで分母の整数を並べたもの)で出力する。47</p>48 49 50<h2>Sample Input 1</h2>51 52<pre>530.(3)54</pre>55 56<h2>Sample Output 1</h2>57<pre>581/359</pre>60 61<br/>62 63<h2>Sample Input 2</h2>64<pre>651.066</pre>67 68<h2>Sample Output 2</h2>69<pre>701/171</pre>72 73<br/>74 75 76<h2>Sample Input 3</h2>77<pre>785.2(143)79</pre>80 81<h2>Sample Output 3</h2>82<pre>8352091/999084</pre>85 86<br/>87 88<h2>Sample Input 4</h2>89<pre>900.073991</pre>92 93<h2>Sample Output 4</h2>94<pre>95739/1000096</pre>97 98<br/>99 