Dead Fraction Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 3478 Accepted: 1162 Description Mike is frantically scrambling to finish his thesis at the last minute. He needs to assemble all his research notes into vaguely coherent for…
思路: 循环小数化分数,枚举所有可能的循环节,取分母最小的那个. 实现: #include <iostream> #include <cstdio> #include <string> using namespace std; const int INF = 0x3f3f3f3f; int gcd(int a, int b) { return !b ? a : gcd(b, a % b); } int lcm(int a, int b) { return a / gcd…
小数化分数2 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4278 Accepted Submission(s): 1725 Problem Description Ray 在数学课上听老师说,任何小数都能表示成分数的形式,他开始了化了起来,很快他就完成了,但他又想到一个问题,如何把一个循环小数化成分数呢?请你写一个程序不但可以…
Dead Fraction Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 1762 Accepted: 568 Description Mike is frantically scrambling to finish his thesis at the last minute. He needs to assemble all his research notes into vaguely coherent form…
小数化分数2 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2988 Accepted Submission(s): 1224 Problem Description Ray 在数学课上听老师说,任何小数都能表示成分数的形式,他开始了化了起来,很快他就完成了,但他又想到一个问题,如何把一个循环小数化成分数呢?请你写一个程序不但可以…
小数化分数2 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5723 Accepted Submission(s): 2339 Problem Description Ray 在数学课上听老师说,任何小数都能表示成分数的形式,他开始了化了起来,很快他就完成了,但他又想到一个问题,如何把一个循环小数化成分数呢?请你写一个程序不但可以…