题目描述 http://www.lydsy.com/JudgeOnline/upload/201712/prob12.pdf 题解 树形dp+记忆化搜索 设 $f[l][r]$ 表示根节点为 $[l,r]$ 的线段树,匹配选择根节点的最大匹配&方案数,$g[l][r]$ 表示根节点为 $[l,r]$ ...
分类:
其他好文 时间:
2018-01-03 11:38:06
阅读次数:
144
"原题" 在金字塔内有一个宝藏p(x,y),现在要取出这个宝藏。 在金字塔内有许多墙,为了进入宝藏所在的房间必须把墙炸开,但是炸墙只能炸每个房间墙的中点。 求将宝藏运出城堡所需要的最小炸墙数。 判断点和直线相交。 枚举每道墙的两个端点和p的连线这条线段和墙的交点的次数最小值即为需要炸墙的最小次数。 ...
分类:
其他好文 时间:
2018-01-01 20:34:01
阅读次数:
130
#include using namespace std; const int maxn=1e4+7; int n,m,cot,sum; struct edge { int u,v,w; bool operator <(const edge &b)const{ return w<b.w; } }g[... ...
分类:
其他好文 时间:
2017-12-31 20:59:09
阅读次数:
124
Python部分 Mention the use of // operator in Python? a=1, b=2, 不用中间变量交换a和b的值 请用自己的算法, 按升序合并如下两个list, 并去除重复的元素 list1 = [2, 3, 8, 4, 9, 5, 6] list2 = [5, ...
分类:
编程语言 时间:
2017-12-31 10:48:40
阅读次数:
241
题目: 洛谷也能评测 题解: De了好长时间BUG发现是自己sort前面有一行for没删,气死. 题目询问第x秒时候前k小的P值之和. 朴素想法: 我们可以把P值离散化,然后对于每个时刻建一棵定义域是离散化后P值的线段树 每个节点维护了这个节点代表区间的任务个数和这些任务离散化之前的P值之和, 对于 ...
分类:
其他好文 时间:
2017-12-30 21:34:49
阅读次数:
148
https://www.luogu.org/problemnew/show/U16887 $f[1] + f[2] + f[3] + .... + f[n] = f[n + 2] - 1$ 矩阵快速幂求出第n+2项即可 ...
分类:
其他好文 时间:
2017-12-30 18:18:01
阅读次数:
130
A. Nearest Minimums You are given an array of n integer numbers a0,?a1,?...,?an?-?1. Find the distance between two closest (nearest) minimums in it. I ...
分类:
其他好文 时间:
2017-12-30 00:25:37
阅读次数:
216
1. babel编译转换时发生了报错: BabelLoaderError: SyntaxError: Unexpected token babel预置的转换器是 babel-preset-es2015 ,并不能转换 Object Rest Operator 特性,可以安装整个stage2的预置器或者 ...
分类:
其他好文 时间:
2017-12-28 17:21:38
阅读次数:
161
n<=100的形如的图有多少生成树。不取模。 $f(i)=3*f(i-1)-f(i-2)+2$,VFK的题解 1 #include<stdio.h> 2 #include<string.h> 3 #include<algorithm> 4 #include<stdlib.h> 5 //#includ ...
分类:
其他好文 时间:
2017-12-28 11:44:31
阅读次数:
121
* *********************************************************************** * This example program shows how to use the operator * segment_object_model_ ...
分类:
其他好文 时间:
2017-12-27 18:14:32
阅读次数:
216