21158_QualifiedPrimes

2022-5-16 18:18| 发布者: Hocassian| 查看: 43| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504947615200-Problem List-采集的数据-后羿采集器.html

Pro.ID

21158

Title

Qualified Primes

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21158

AC

37

Submit

238

Ratio

15.55%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Farmer John has begun branding the cows with sequential prime numbers. Bessie has noticed this and is curious about the occurrence of various digits in those brands.

    Help Bessie determine the number of primes in the inclusive range A..B (1 ≤ AB ≤ 4,000,000 ; BA+1,000,000 ;  one test case has BA+2,000,000 ) that contain a supplied digit D.

    A prime is a positive integer with exactly two divisors (1 and itself). The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, and, 29.

    输入

    * Line 1: Three space-separated integers: A, B, and D

    输出

    Description

    Farmer John has begun branding the cows with sequential prime numbers. Bessie has noticed this and is curious about the occurrence of various digits in those brands.

    Help Bessie determine the number of primes in the inclusive range A..B (1 ≤ AB ≤ 4,000,000 ; BA+1,000,000 ;  one test case has BA+2,000,000 ) that contain a supplied digit D.

    A prime is a positive integer with exactly two divisors (1 and itself). The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, and, 29.

    Input

    * Line 1: Three space-separated integers: A, B, and D

    Output

    * Line 1: The count of primes in the range that contain the digit D.

    Sample Input

    10 15 3

    Sample Output

    1

    Hint

    Input Details

    How many primes in the range 10..15 contain the digit 3?

    Output Details

    Just 13 in this range contains a '3'.

    Source

    样例输入

    10 15 3

    样例输出

    1

    提示

    Input Details

    How many primes in the range 10..15 contain the digit 3?

    Output Details

    Just 13 in this range contains a '3'.


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部