2020-04-25 10:22:20 +08:00

30 lines
553 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# P3383 【模板】线性筛素数
题目背景
本题已更新,从判断素数改为了查询第 kk 小的素数
提示:如果你使用 cin 来读入,建议使用 std::ios::sync_with_stdio(0) 来加速。
题目描述
如题,给定一个范围 nn有 qq 个询问,每次输出第 kk 小的素数。
输入格式
第一行包含两个正整数 n,qn,q分别表示查询的范围和查询的个数。
接下来 qq 行每行一个正整数 kk表示查询第 kk 小的素数。
输出格式
输出 qq 行,每行一个正整数表示答案。
输入输出样例
输入 #1复制
100 5
1
2
3
4
5
输出 #1复制
2
3
5
7
11