洛谷题解 | AT_abc321_c Primes on Interval
目录[*]题目翻译
[*]题目描述
[*]输入格式
[*]输出格式
[*]样例 #1
[*]样例输入 #1
[*]样例输出 #1
[*]样例 #2
[*]样例输入 #2
[*]样例输出 #2
[*]样例 #3
[*]样例输入 #3
[*]样例输出 #3
[*]题目简化
[*]题目思路
[*]AC代码
题目翻译
【题目描述】
你决定用素数定理来做一个调查. 众所周知, 素数又被称为质数,其含义就是除了数字一和本身之外不能被其他任何的数字除尽.
现在给定一个正整数序列 $a,a+1,\cdots,b$ $(a \le b)$, 请找出一个最小值 $l$, 使其满足对于任意一个长度为 $l$ 的子串, 都包含 $k$ 个质数.
找到并输出符合要求的最小值 $l$, 如果不存在符合要求的长度 $l$, 则输出 $-1$.
【输入格式】
输入一行, 包含三个用空格隔开的整数 $a,b,k$ ($1 \le a,b,k \le 10^{6}; a \le b$)
【输出格式】
输出一行, 为符合要求的最小值 $l$, 若不存在, 输出 $-1$.
题目描述
You've decided to carry out a survey in the theory of prime numbers. Let us remind you that a prime number is a positive integer that has exactly two distinct positive integer divisors.
Consider positive integers $ a $ , $ a+1 $ , $ ... $ , $ b $ $ (a
页:
[1]