POJ 1930 Dead Fraction

在安装之后使用labelme出现qtpy.PythonQtError:No Qt bindings could be found错误 我在base环境(python3.7)可成功安装和使用labelme,而在同py37版本和py36的虚拟环境中可安装labelme包,但在使用的时候出现报错,如下: 我尝试着去解决第一个错误提示,错误提示为:moduleNotFoundError:No module named ‘PySide’,结果掉入了一个无止无尽的坑,看到网上有朋友说这个只能在py27-py35才能安装,还有说需要VC+ 140等,他们说的这个解决方案只针对于这个缺包的描述,而我们仅仅只需要一个labelme,因此我直接对后面的错误 阅读详情

 

Dead Fraction
Time Limit: 1000MS Memory Limit: 30000K
Total Submissions: 1198 Accepted: 354

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 in the next 3 days. Unfortunately, he notices that he had been extremely sloppy in his calculations. Whenever he needed to perform arithmetic, he just plugged it into a calculator and scribbled down as much of the answer as he felt was relevant. Whenever a repeating fraction was displayed, Mike simply reccorded the first few digits followed by "...". For instance, instead of "1/3" he might have written down "0.3333...". Unfortunately, his results require exact fractions! He doesn't have time to redo every calculation, so he needs you to write a program (and FAST!) to automatically deduce the original fractions. 
To make this tenable, he assumes that the original fraction is always the simplest one that produces the given sequence of digits; by simplest, he means the the one with smallest denominator. Also, he assumes that he did not neglect to write down important digits; no digit from the repeating portion of the decimal expansion was left unrecorded (even if this repeating portion was all zeroes).

Input

There are several test cases. For each test case there is one line of input of the form "0.dddd..." where dddd is a string of 1 to 9 digits, not all zero. A line containing 0 follows the last case.

Output

For each case, output the original fraction.

Sample Input

0.2...
0.20...
0.474612399...
0

Sample Output

2/9
1/5
1186531/2500000

Hint

Note that an exact decimal fraction has two repeating expansions (e.g. 1/5 = 0.2000... = 0.19999...).

Source

 

 

 

CUDA&PCL 点云体素下采样 阅读详情

相关推荐

新手如何学习车载底层嵌入式软件开发(AutoSar)

汽车嵌入式开发

ACarSoft的博客 4221

POJ 1930(模拟+思维)

题意 给一个小于1大于0的无限循环小数,将其化成分数,输出分母最小的情况。 分析 首先题目给定了数字最长是9位,组成是0.abcde…这样的形式,所以可以直接读取中间的数字并用ll存起来。然后遍历9种循环情况,分别求出他们的分数形式。下面说下如何化成分数。 隐约记得这个是小学课本上的东西,首先将这个数乘pow(10,循环节的长度),然后减去这个整数,举个例子,0.923333…这里我们...

cugsl的博客 334

基于航位推算与多传感器融合的高精度避障小车设计

航位推算(Dead Reckoning)是一种在无外部定位信号下通过里程计与惯性测量单元(IMU)持续积分估计位姿的基础导航方法,其核心在于运动学建模、误差累积抑制与多源数据融合。该技术具备低依赖、高实时、强确定性等工程优势,广泛应用于服务机器人、AGV、竞赛无人平台等受限环境下的自主导航系统。结合编码器高分辨率测距与九轴IMU姿态解算,可显著抑制纯里程计漂移,提升短时定位精度至厘米级。本文以全国大学生电子设计竞赛K题为背景,深入实现了一种面向确定性场地的离线建图+航位推算双模协同架构,重点解决嵌入式资源约

weixin_36328210的博客 81

poj 1930 (gcd)

#include <iostream> #include <cstdio> #include <iomanip> #include <string> #include <cstdlib> #include <cstring> #include <queue> #include <set> #inclu...

Fawkess的博客 204

【FPGA】AD9694调试注意事项

基于FPGA的AD9694设计及其注意事项,包括同步的设计注意事项

weixin_41246509的博客 2904

STM32实战:如何快速移植野火PID调试助手协议到你的电机控制项目

本文详细解析了如何将野火PID调试助手协议快速移植到STM32电机控制项目中。通过深度剖析协议帧格式、数据解析逻辑及环形缓冲区应用,提供了从工程结构规划、核心函数适配到串口中断集成的完整移植步骤。文章还分享了协议健壮性增强、数据上报频率优化等高级调试技巧,帮助开发者构建稳定可靠的上位机调试通道,大幅提升PID参数整定效率。

weixin_29171129的博客 468

POJ 1930 解题报告 无限循环小数化分数

Dead FractionTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 1258 Accepted: 379DescriptionMike is frantically scrambling to finish his thesis at the last minute. He needs to assemble all his research notes into vaguely coherent form in the next 3

施工中请绕行 4319

时间序列数据预测——15种时序大模型

本文综述了时间序列大模型(TSFM)的最新进展,系统介绍了11种主流模型(如TimeGPT、Lag-Llama、Moirai等)的架构特点、训练数据和创新点,并对比分析了它们在单变量/多变量预测、概率预测等功能上的差异。研究表明,基于"大规模预训练-微调/零样本"范式的TSFM在标准数据集(如M4、ETT)上展现出优于传统方法的性能,Time-MoE等模型更达到SOTA水平。但TSFM仍面临计算成本高、可解释性差等挑战,未来发展方向包括轻量级架构、多模态融合和可解释性增强。

m0_56592100的博客 4074

POJ 1930 Dead Fraction(循环小数化分数)

Dead Fraction Time Limit: 1000MS   Memory Limit: 30000K Total Submissions:3475   Accepted: 1159 Description Mike is frantically scrambling to finish his thesis at the l

albertluf的博客 422

YOLOv12改进策略【Neck】| 使用CARAFE轻量级通用上采样算子

CARAFE内容感知的特征重新组合。

Limiiiing的博客 664

半小时搞定Yolov5安装配置及使用(详细过程)

Yolov51. 下载Yolov52. 安装Yolov5 在下载配置Yolov5前,先要安装好Anaconda环境,可参考之前博文:最新Anaconda3的安装配置及使用教程(详细过程) 1. 下载Yolov5 首先下载Yolov5源码: Yolov5 Github地址:https://github.com/ultralytics/yolov5 直接git clone到本地工作目录,等待下载完成: Yolov5代码目录架构: 2. 安装Yolov5 源码下完后,下面开始安装Yolov5所需模块,

HowieXue 薛永浩的博客 12万+

POJ 1930 Dead Fraction【数学】

Dead Fraction Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 2463   Accepted: 802 Description Mike is frantically scrambling to finish his thesis at the l

希望的专栏 643

制作INCA和CANape通用的A2L

CANape和INCA通用的A2L配置与修改

赞的博客 5966

POJ1930Dead Fraction

Dead Fraction Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 2097   Accepted: 669 Description Mike is frantically scrambling to finish his thesis at the l

5年Java后端研发,分享个人读书学习笔记。 492

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

Dead Fraction POJ - 1930

Dead Fraction POJ - 1930  Mike is frantically scrambling to finish his thesis at the last minute. He needs to assemble all his research notes into vaguely coherent form in the next 3 days. Unfortunat

ZJLORD 340

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

数论——Dead Fraction(POJ - 1930 )

数论 ——Dead Fraction(POJ - 1930 ) Mike is frantically scrambling to finish his thesis at the last minute. He needs to assemble all his research notes into vaguely coherent form in the next 3 days. Unfortunately, he notices that he had been extremely sloppy i

accrazypt的博客 258

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

POJ 1930 Dead Fraction

poj1930 题目意思:给定一个无限循环小数,把它转换成分数。 这个需要一定姿势水平。。。纯循环9做分母,有几个循环数,就有几个9,例如0.3就是9分之3,0.654就是999分之654。。等等混循环把0.228转换成分数(8是循环节) =[(228/1000)+8/9000)] =228/(900+100)+8/9000 =[(228/900)-(228/9000)]+(8/9000)

相思作坊半世离殇的博客 535

POJ -1930 Dead Fraction (GCD+循环小数化分数)

题目: POJ -1930 Dead Fraction(GCD+循环小数化分数) 题意: 给你一个循环小数,小数后有一部分省略,求小数转换为分数后的分母最小的分数。 题解: 1.首先枚举循环节长的a(0 &lt; a &lt;= len-5) ,len = size(),循环节为s.substr(len-3-a,a); 2.然后由后向前匹配循环节,找到循环节第一次出现的位置...

点滴 541

Dead Fraction POJ 1930(数学)

原题 题目链接 题目分析 无限循环小数化分数.把小数用分数表示,后面等比数列可以用求和公式化简,最后可以总结出一个通用公式(可以百度),这里不细讲.需要注意一下,题目没有明确说明循环部分从哪开始,因此需要枚举循环部分,找到分母最小的输出即可. 代码 1 #include <iostream> 2 #include <algorithm> 3...

dashengchong6303的博客 182

POJ1930 Dead Fraction 数学

这题是个数学题,就是gei

LoveKobe_的专栏 1055

POJ 1930 - Dead Fraction(数学)

题目: http://poj.org/problem?id=1930 题目: 将无限循环小数转化成分数,但是循环节不确定,要求出分母最小的那个分数。 思路: 百度知道了 无限循环小数转化成分数的方法。详见笔记=。= CODE: #include #include #include #include using namespace std; typedef long long

Halo 881

POJ 1930 Dead Fraction 数论

别人说这是小学奥数水平的题目,orz,作者受到了极大的打击。 如果是用笔写的话相信很多人都能将循环小数化成分数。 来个例子吧:0.333.....怎么化成分数呢? 设 x = 0.333...... 10x = 3.33...... 10x - x = 3 9x = 3 x = 1 / 3 和这个思路类似,对于一般情况,我们可以推导出一个公式(推导出了公式才方便编程)。 引用别人

每天都要进步哦~ 536

POJ 1930 Dead Fraction (小数化分数)

Dead Fraction Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 2080   Accepted: 661 Description Mike is frantically scrambling to finish his thesis at the l

TaoSama's Microcosm 779

POJ-1930-Dead Fraction

很费解这个题,最后卡了白天死在了全为0的情况了~悲剧 代码: #include #include #include #include #include using namespace std; const int inf=1<<29; char str[100]; bool isallzero(char *str) { for(int i=2;i<strlen(str)-3;i++)

z309241990的专栏 1344

poj 1930 Dead Fraction

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 in the next 3 days. Unfortunately, he notice...

weixin_30649859的博客 138

Dead Fraction [POJ1930]

题意: 很有意思的一道题,,将一个无限循环小数转化成分母最小的精确分数值....,循环的部分不一定是最后一位。 Sample Input 0.2... 0.20... 0.474612399... 0 Sample Output 2/9 1/5 1186531/2500000 1 #include<set> 2 #include<map&g...

weixin_30481087的博客 93
上一篇: POJ 1932 XYZZY
下一篇: POJ 2003 Hire and Fire
bobten2008
博客等级 码龄18年 153粉丝 157原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值