摘要:
分析 后缀数组算法里的height数组每个区间的最小值都对应着原串的两个后缀的LCP。神奇的性质。 代码 cpp // 自己撸的SA常数还是很大 include include include using namespace std; typedef long long ll; const int 阅读全文
摘要:
Problem Description Chika is elected mayor of Numazu. She needs to manage the traffic in this city. To manage the traffic is too hard for her. So she 阅读全文
摘要:
题目描述 You have N integers A1, A2, ... , AN. You are asked to write a program to receive and execute two kinds of instructions: 1. C a b means performin 阅读全文
摘要:
题目链接 https://www.nowcoder.com/acm/contest/139/F 分析 枚举i从1到a[i]的最大值,每个段考虑i的贡献。 关键在于要在O(n)或者O(nlogn)时间内求出一个最高次为n次的多项式在x(x include include include include 阅读全文
摘要:
题目描述 After successive failures in the battles against the Union, the Empire retreated to its last stronghold. Depending on its powerful defense system 阅读全文
摘要:
题目描述 给定一个整数 M,对于任意一个整数集合 S,定义“校验值”如下: 从集合 S 中取出 M 对数(即 2∗M 个数,不能重复使用集合中的数,如果 S 中的整 数不够 M对,则取到不能取为止),使得“每对数的差的平方”之和最大,这个最大值 就称为集合 S 的“校验值”。 现在给定一个长度为 N 阅读全文
摘要:
题目描述 For this problem, you will write a program that reads in a sequence of 32 bit signed integers. After each odd indexed value is read, output the m 阅读全文