| ps | |
|---|---|
| 링크 | acmicpc.net/… |
| 출처 | BOJ |
| 문제 번호 | 6219 |
| 문제명 | 소수의 자격 |
| 레벨 | 실버 3 |
| 분류 |
정수론 |
| 시간복잡도 | O(nloglogn) |
| 인풋사이즈 | n<=4,000,000 |
| 사용한 언어 | Python |
| 제출기록 | 53792KB / 180ms |
| 최고기록 | 180ms |
| 해결날짜 | 2022/07/23 |
"""Solution code for "BOJ 6219. 소수의 자격".
- Problem link: https://www.acmicpc.net/problem/6219
- Solution link: http://www.teferi.net/ps/problems/boj/6219
Tags: [Sieve]
"""
from teflib import numtheory
def main():
A, B, D = [int(x) for x in input().split()]
d_str = str(D)
answer = 0
for p in numtheory.prime_list(A, B):
if d_str in str(p):
answer += 1
print(answer)
if __name__ == '__main__':
main()
teflib.numtheory.prime_list