【链接】 "我是链接,点我呀:)" 【题意】 让你在一个递增数组中选择一个最长子序列使得gcd(a[i],a[i+1]) 1 【题解】 设f[i]表示以一个"含有素因子i的数字"作为序列的结尾的最长序列的长度 显然更新的时候 假设枚举到了a[i] 先求出它所有的素因子p[] 因为要和前面一个数字不互 ...
分类:
其他好文 时间:
2019-03-09 21:52:08
阅读次数:
202
可用函数 unescape() 将字符的unicode编码转化为16进制序列(转义序列,转义序列(escape sequences)) decodeURI() decodeURIComponent() 不编码字符 springboot自动解码配置: server.tomcat.uri-encodin ...
分类:
编程语言 时间:
2019-03-07 14:07:46
阅读次数:
225
Little Lesha loves listening to music via his smartphone. But the smartphone doesn't have much memory, so Lesha listens to his favorite songs in a wel ...
分类:
其他好文 时间:
2019-03-03 22:16:21
阅读次数:
129
A .DZY Loves Sequences pro:给定长度为N的序列,你最多可以改变一个数的值,问最长严格上升子序列长度。 N<1e5. sol:分几种情况,一种的不改变; 一种是改变,然后接上一个; 一个是改变中间一个,接上两段,而且满足a[mid-1]<a[mid]<a[mid+1] B . ...
分类:
其他好文 时间:
2019-03-01 00:19:13
阅读次数:
284
1020 Tree Traversals Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, y ...
分类:
其他好文 时间:
2019-02-27 01:41:50
阅读次数:
212
from fluent python: Python sequences are often categorized as mutable or immutable, but it is also useful to consider a different axis: flat sequences ...
分类:
编程语言 时间:
2019-02-23 10:40:20
阅读次数:
267
Mohammad has recently visited Switzerland. As he loves his friends very much, he decided to buy some chocolate for them, but as this fine chocolate is ...
分类:
其他好文 时间:
2019-02-20 09:35:38
阅读次数:
104
"传送门" 题意:求一个最长的序列,满足序列严格单调递增,任意相邻两个数非互质且所有的数都来自长度为n且单调递增的序列a三个条件. 分析:既然原序列本身满足单调递增,所以对于这个条件我们可以不管.所有的数都来自a序列,额,这个条件更没必要管.所以我们从序列相邻两个数非互质入手. 设f[i]表示以a[ ...
分类:
其他好文 时间:
2019-02-13 20:59:41
阅读次数:
175
Good Sequences n2DP就不写了。 直接考虑优化: 既然相邻的两个要求不互质,那么存在同样的约数。 那么我们考虑枚举当前数x的约数, 当前情况下的最优解 只能从前面的 含x的约数的 数中的最优解转移过来。 如当前x=8,那么f[x]可以由前面的含有2或4这个约数的数中的最优解转移。 那 ...
分类:
其他好文 时间:
2019-02-13 09:29:00
阅读次数:
171
C. Trailing Loves (or L'oeufs?) 题目传送门 题意: 求n!在b进制下末尾有多少个0? 思路: 类比与5!在10进制下末尾0的个数是看2和5的个数,那么 原题就是看b进行质因数分解后,每个因数个数的最小值 代码: #include<bits/stdc++.h> usin ...
分类:
其他好文 时间:
2019-02-13 00:34:13
阅读次数:
163