10124_SuperprimeRib

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

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

Pro.ID

10124

Title

Superprime Rib

Title链接

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

AC

98

Submit

202

Ratio

48.51%

时间&空间限制

  • Time Limit: 200/100 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Butchering Farmer John's cows always yields the best prime rib. You can tell prime ribs by looking at the digits lovingly stamped across them, one by one, by FJ and the USDA. Farmer John ensures that a purchaser of his prime ribs gets really prime ribs because when sliced from the right, the numbers on the ribs continue to stay prime right down to the last rib, e.g.:

        7  3  3  1

    The set of ribs denoted by 7331 is prime; the three ribs 733 are prime; the two ribs 73 are prime, and, of course, the last rib, 7, is prime. The number 7331 is called a superprime of length 4.

    Write a program that accepts a number N ( 1 ≤ N ≤ 8 ) of ribs and prints all the superprimes of that length.

    The number 1 (by itself) is not a prime number.

    输入

    Multiple test cases, every case is a single line with the number N.

    输出

    Description

    Butchering Farmer John's cows always yields the best prime rib. You can tell prime ribs by looking at the digits lovingly stamped across them, one by one, by FJ and the USDA. Farmer John ensures that a purchaser of his prime ribs gets really prime ribs because when sliced from the right, the numbers on the ribs continue to stay prime right down to the last rib, e.g.:

        7  3  3  1

    The set of ribs denoted by 7331 is prime; the three ribs 733 are prime; the two ribs 73 are prime, and, of course, the last rib, 7, is prime. The number 7331 is called a superprime of length 4.

    Write a program that accepts a number N ( 1 ≤ N ≤ 8 ) of ribs and prints all the superprimes of that length.

    The number 1 (by itself) is not a prime number.

    Input

    Multiple test cases, every case is a single line with the number N.

    Output

    For every test case, the superprime ribs of length N, printed in ascending order one per line.

    Sample Input

    4

    Sample Output

    2333
    2339
    2393
    2399
    2939
    3119
    3137
    3733
    3739
    3793
    3797
    5939
    7193
    7331
    7333
    7393

    Source

    样例输入

    4

    样例输出

    2333
    2339
    2393
    2399
    2939
    3119
    3137
    3733
    3739
    3793
    3797
    5939
    7193
    7331
    7333
    7393

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部