为啥最近都没有arc啊... A Favorite Sound B K th Common Divisor 显然,就是求gcd的第k小的因子。 cpp include include include include include include include include include in ...
分类:
其他好文 时间:
2019-03-03 22:29:22
阅读次数:
145
正解:计数dp 解题报告: 传送门! umm其实我jio得dp的题目的话就难在思想昂,,,知道状态知道转移就不难辣QAQ 所以就不说别的了直接写下思路放下代码就over辣QAQ 最基础的思想就是f[i][j][k][p]:dp到第i个点了,第一种颜色最后一次出现在j第二种在k第三种在p的方案数 然后 ...
分类:
其他好文 时间:
2019-03-03 20:50:17
阅读次数:
204
「WC2016」论战捆竹竿 前置知识 参考资料:《论战捆竹竿解题报告—王鉴浩》,《字符串算法选讲—金策》。 Border&Period 若前缀 $pre(s,x)?$ 与后缀 $suf(s,n x 1)?$ 相等,则 $pre(s, x)?$ 是 $s?$ 的一个 $\text{Border}?$。 ...
分类:
其他好文 时间:
2019-03-03 20:32:43
阅读次数:
259
题目要求 You have an array of logs. Each log is a space delimited string of words. For each log, the first word in each log is an alphanumeric identifier. ...
分类:
其他好文 时间:
2019-03-02 10:21:50
阅读次数:
227
"「JLOI2015」管道连接" 先按照斯坦纳树求一个 然后合并成斯坦纳森林 直接枚举树的集合再dp一下就好了 Code: cpp include include include include using std::min; const int N=1 void read(T &x) { x=0; ...
分类:
其他好文 时间:
2019-02-26 13:50:33
阅读次数:
173
题目要求 You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontal ...
分类:
其他好文 时间:
2019-02-24 10:52:19
阅读次数:
183
题目要求 We are given two sentences A and B. (A sentence is a string of space separated words. Each word consists only of lowercase letters.) A word is un ...
分类:
其他好文 时间:
2019-02-22 10:28:04
阅读次数:
204
"题面" 把$N$个无色格子排成一行,选若干个格子染成黑色,要求每个黑色格子之间至少间隔$M$个格子,求方案数 思路: 矩阵加速 根据题面,这一题似乎可以用递推 设第$i$个格子的编号为$i$,有$i$个格子时的方案数为$f(i)$ 显然,当 $i \le M+1$ 时, 可以所有格子 不染色 (方 ...
分类:
其他好文 时间:
2019-02-21 21:39:20
阅读次数:
176
题目要求 Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence. Two binary trees are c ...
分类:
其他好文 时间:
2019-02-17 11:15:34
阅读次数:
185
题目要求 Given a tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child ...
分类:
其他好文 时间:
2019-02-14 11:48:36
阅读次数:
207