ICode9

精准搜索请尝试: 精确搜索
  • NC235228 素数的个数2022-07-09 08:00:25

    https://ac.nowcoder.com/acm/problem/235228 思路:用线性筛筛出\(\sqrt r\)以内的质数,再筛出区间L~R的质数。 点击查看代码 #include <bits/stdc++.h> using namespace std; int cnt = 0; bool vis[1000004]; int prim[50004]; void sieve(int n) { vis[1] = 1; for(in

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有