摘要:
基础数论 素数 Eratosthenes 筛法 cpp void gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } cpp void exgcd(int a, int b, int &d, int &x, int &y){ if(!b) 阅读全文
摘要:
"题目链接" 题目描述 给定一个长度为 n 的字符串 S,令 Ti 表示它从第 i 个字符开始的后缀。求 $\sum_{1\le i include include define maxn 500010 define INF 1000000000 define ll long long using 阅读全文
摘要:
"题目链接" 题意翻译 输入2 个长度不大于250000的字符串,输出这2 个字符串的最长公共子串。如果没有公共子串则输出0 。 思路 求两个串的最长公共子串 代码 cpp include include include include define maxn 500010 using namesp 阅读全文
摘要:
"题目链接" 题目描述 农夫John发现他的奶牛产奶的质量一直在变动。经过细致的调查,他发现:虽然他不能预见明天产奶的质量,但连续的若干天的质量有很多重叠。我们称之为一个“模式”。 John的牛奶按质量可以被赋予一个0到1000000之间的数。并且John记录了N(1 include include 阅读全文