编程介的小学生 2019-06-05 20:40 采纳率: 20.5%
浏览 196

cpu的自动纠错的算法的一个实现问题,怎么使用C语言的程序编写的技术思想来用代码解决此题

Problem Description
The well known hardware manufacturing company Processors for Professors is about to release a highly specialized CPU with exceptional functionality in, amongst other areas, number theory. It has, for example, an instruction PFACT that takes one parameter and returns all prime factors of that parameter, with an outstanding execution speed. It has, however, one considerable problem. The scientists at the testing lab has just found out that the PFACT instruction for some special input values freaks out and makes the entire processor explode. Even though this could be an amusing effect, it is not the way it was intended to work. The skilled mathematicians have, by trial and error, found that the explosive numbers all share the same interesting number theoretic properties, which might be of help when troubleshooting.

An explosive number is a number where all s are distinct prime numbers such that . A and B are always integers, and might be different for different explosive numbers.

For example, the processor will explode when factorizing the number 4505, because 4505 = 1*5*17*53 and 5 = 3*1+2, 17 = 3*5+2 and 53 = 3*17+2 and the numbers 5, 17 and 53 are all prime numbers. In this case A = 3 and B = 2.

You are kindly asked to write a computer program that will aid this company in estimating the impact of the errors, by calculating the amount of explosive numbers that exists within a given range of integers.

Input
The input starts with a row containing the number 0 <= N <= 100 of test cases that will follow. For each test case, there will be one row containing two integers, separated by a single space. These numbers are such that .

Output
For each test case, output the number of explosive numbers that exist in
the range .

Sample Input
2
4505 4505
0 5000

Sample Output
1
5

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
    • ¥15 错误 LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
    • ¥15 让node服务器有自动加载文件的功能
    • ¥15 jmeter脚本回放有的是对的有的是错的
    • ¥15 r语言蛋白组学相关问题
    • ¥15 Python时间序列如何拟合疏系数模型