主页
试题仓库
题目列表
试题分类
经典教材
竞赛作业
竞赛列表
提交状态
图灵学院
TuringMOOC
图灵书屋
图灵商城
图灵实验室
图灵会员
历史荣誉
支持我们
图灵IDE
用户/排名
AOJ排名
实名认证
请登录
常用链接
AOJ考试平台
老赵的Gitee代码
编译原理模拟考试平台
Java技术手册
FCC网站
菜鸟网
在线工具箱
字节豆包GPT
代码可视化
力扣网
牛客网
洛谷
杭电OJ
CodeForce
隐藏编译器
Problem 2881 --1.5.3 Superprime Rib
2881: 1.5.3 Superprime Rib
上一题
正确率: $100.00\%$
下一题
Time Limit
$1$ 秒/Second(s)
Memory Limit
$512$ 兆字节/Megabyte(s)
提交总数
$3$
正确数量
$3$
"
裁判形式
标准裁判/Standard Judge
我的状态
尚未尝试
难度
分类标签
usaco
递归
×
为本题添加算法分类(请不要超过5个)
当前分类(单击移除):
usaco
递归
单击选择分类:
Description
<p> <p> 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.: </p> <pre> 7 3 3 1 </pre> <p> 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. </p> <p> Write a program that accepts a number N 1 <=N<=8 of ribs and prints all the superprimes of that length. </p> <p> The number 1 (by itself) is not a prime number. </p> <h3> PROGRAM NAME: sprime </h3> </p> <h3> </h3>
Input
A single line with the number N.
Output
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
推荐代码
查看2881 所有题解
上传题解视频得图灵币
本题记录
用 户(点击查看用户)
运行号(点击购买题解)
时 间
算法最快[$0 $ms]
0
内存最少[$0 $KB]
0
第一AC
0
第一挑战
0
赛题来源
usaco training
usaco Training
AOJ
Please Login