PAT 2021 春季 甲级 7-1 Arithmetic Progression of Primes ...
分类:
其他好文 时间:
2021-03-15 11:19:56
阅读次数:
0
Sexy primes are pairs of primes of the form (p, p+6), so-named since "sex" is the Latin word for "six". (Quoted from http://mathworld.wolfram.com/Sexy ...
分类:
其他好文 时间:
2021-02-20 11:45:24
阅读次数:
0
考虑到不知道第$104$个素数有多大,可以先用程序测试下第$104$个素数是多少。 const int N=2e5+10; int primes[N],cnt; bool vis[N]; void init(int n) { for(int i=2;i<=n;i++) if(!vis[i]) { p ...
分类:
其他好文 时间:
2021-02-16 12:14:01
阅读次数:
0
1.情况 在模版里用反向解析时候报错: ‘set’ object is not reversible 2.寻找 (1)首先没有报:404,说明路由没写错 (2)正常报错不可逆问题,包应该没导错,保险起见,我又检查了包 (3) 既然说set的对象不可逆,那先去查看redirect的对象,解析的对象却可 ...
分类:
其他好文 时间:
2020-08-18 13:26:53
阅读次数:
101
题目 题目链接 已知一个十进制数n,和基数m,判断 n是否为质数;且n转换为m进制并反转后对应的十进制数是否为质数 解题思路 1 质数判断 2 进制转换 易错点 1 输入的不一定为质数,题目要求判断两个内容: n是否为质数;n转换为m进制并反转后对应的十进制数是否为质数 2 m<=10,所以十进制进 ...
分类:
其他好文 时间:
2020-07-19 11:49:20
阅读次数:
64
朴素版筛选质数 时间复杂度O(nlogn) int primes[N], cnt; // primes[]存储所有素数 bool st[N]; // st[x]存储x是否被筛掉 void get_primes(int n) { for (int i = 2; i <= n; i ++ ) { if ...
题意:给你两个一元多项式$f(x)$和$g(x)$,保证它们每一项的系数互质,让$f(x)$和$g(x)$相乘得到$h(x)$,问$h(x)$是否有某一项系数不被$p$整除. 题解:这题刚开始看了好久不知道怎么写,但仔细看题目给的条件可能会看出一点门道来,我们知道,$c_$是由$f(x)$和$g(x ...
分类:
其他好文 时间:
2020-07-01 22:17:58
阅读次数:
54
一、技术总结 这一题主要学到了,进制转换如下: int len = 0; do{ d[len++] = n % radix;//转化成该进制,数组低位表示转换后进制的低位; n /= radix; }while(n != 0); int p = 1; for(int i = len - 1; i > ...
分类:
其他好文 时间:
2020-06-30 22:39:20
阅读次数:
56
https://www.cnblogs.com/grandyang/p/5144918.html 1. class Solution { public: int nthSuperUglyNumber(int n, vector<int>& primes) { vector<int> res(1,1) ...
分类:
其他好文 时间:
2020-06-30 10:56:23
阅读次数:
38
A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a re ...
分类:
其他好文 时间:
2020-06-24 19:28:08
阅读次数:
55