随笔分类 - 板子
摘要:long long 范围内的开根 浮点数的开根 java 大数套牛顿迭代
阅读全文
摘要:ll prime[100]; ll cnt; void getprime(){ cnt = 0; ll num = m; for(ll i = 2; i*i 1) prime[cnt++] = num; } void solve() { ll ans = 0; // cnt 下标从0开始 for(ll i = 1; i < (1<<cnt); i++...
阅读全文
摘要:Description 有n朵花,每朵花有三个属性:花形(s)、颜色(c)、气味(m),用三个整数表示。 现在要对每朵花评级,一朵花的级别是它拥有的美丽能超过的花的数量。 定义一朵花A比另一朵花B要美丽,当且仅Sa>=Sb,Ca>=Cb,Ma>=Mb。 显然,两朵花可能有同样的属性。需要统计出评出每
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/133/D来源:牛客网 题目描述 Applese打开了m个QQ群,向群友们发出了组队的邀请。作为网红选手,Applese得到了n位选手的反馈,每位选手只会在一个群给Applese反馈 现在,Applese要挑选其中的k名
阅读全文
摘要:推荐博客 : https://oi.men.ci/fft-notes/ 卷积的理解 : https://www.zhihu.com/question/22298352?rf=21686447 题目链接 :http://uoj.ac/problem/34 这是一道模板题。给你两个多项式,请输出乘起来后
阅读全文
摘要:A musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the piano. It i
阅读全文
摘要:推荐博客:https://www.cnblogs.com/zinthos/p/3899725.html 所谓的后缀数组,就是将字符串的 n 个后缀全部取出来,采用字典序的排序方式,将排序好的后缀开头位置顺次放进数组中。 在后缀数组中,有几个关键的变量 1 . SA 数组,若 sa[ i ] = j
阅读全文
摘要:推荐博客 :https://blog.csdn.net/jjj19891128/article/details/22685605 https://blog.csdn.net/jq_develop/article/details/44981127 结构体的定义 点 直线 多边形 圆 整体一起 jls
阅读全文
摘要:推荐博客 : https://blog.csdn.net/flushhip/article/details/80068888 百度文库 : https://wenku.baidu.com/view/dd6e9d00a58da0116d17491e.html 矩阵10大经典问题:http://www.
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/105/G来源:牛客网 题目描述 这是一个加强版的斐波那契数列。 给定递推式 求F(n)的值,由于这个值可能太大,请对109+7取模。 输入描述: 第一行是一个整数T(1 ≤ T ≤ 1000),表示样例的个数。以后每个
阅读全文
摘要:In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2. For example, the first ten terms of the Fibonacci sequence are:
阅读全文
摘要:#include #include #include #include #include #include using namespace std; //**************************************************************** // Miller_Rabin 算法进行素数测试 //速度快,而且可以判断 =c)a%=c; ...
阅读全文
摘要:XOR is a kind of bit operator, we define that as follow: for two binary base number A and B, let C=A XOR B, then for each bit of C, we can get its val
阅读全文
摘要:推荐博客 :https://www.cnblogs.com/handsomecui/p/4755455.html 在很早前就听过欧拉函数,不过一直没有去看,最近在补数论的时候,学一下它 根据约数定理,我们很容易求出来一个数约数的个数 欧拉函数的定义是这样的, 小于 n 且与 n 互素的正整数(包括1
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/81/C来源:牛客网 题目描述 给出一个 0 ≤ N ≤ 105 点数、0 ≤ M ≤ 105 边数的有向图, 输出一个尽可能小的点集,使得从这些点出发能够到达任意一点,如果有多个这样的集合,输出这些集合升序排序后字典序
阅读全文
摘要:You are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a ne
阅读全文
摘要:#include #include #include #define N 100010 using namespace std; typedef long long LL; int a[N]; //原数组 int sorted[N]; //排序好的数组 //是一棵树,但把同一层的放在一个数组里。 int num[20][N]; //num[i] 表示i前面有多少个点进入左孩子 ...
阅读全文