PAT刷题笔记——1010 Radix

该博客介绍了PAT编程竞赛中的一道题目,涉及将两个不同基数的正整数转换成相同基数以使它们相等的问题。作者分析了题目要求,指出当给定一个数的基数时,需要找到另一个数的基数。文章提到了处理数字大小限制、进制转换以及使用二分搜索优化算法的策略,并给出了通过测试的代码示例。
摘要由CSDN通过智能技术生成

PAT刷题笔记——1010 Radix

题目

Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes \fbox{\color{red}yes} yes, if 6 is a decimal number and 110 is a binary number.
Now for any pair of positive integers N ​ 1 N​_{1} N1 and N ​ 2 N​_{2} N2, your task is to find the radix of one number while that of the other is given.
Input Specification:
Each input file contains one test case. Each case occupies a line which contains 4 positive integers:
N1 N2  tag   radix \fbox{N1 N2 \textbf{tag} \color{red}radix} N

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值