码迷,mamicode.com
首页 >  
搜索关键字:zoj 3690 choosing n    ( 3596个结果
ZOJ-Crashing Balloon
1 #include 2 using namespace std; 3 bool flagM, flagN; 4 void dfs(int m, int n, int factor){ 5 if (m == 1 && n == 1){//两个都被完全因式分解 6 flagM = flagN = tr... ...
分类:其他好文   时间:2018-09-19 19:44:01    阅读次数:210
ZOJ red black tree
#include <cstdio> #include <cstring> #include <cmath> #include <queue> #include <map> #include <vector> #include <iostream> #include <algorithm> using ...
分类:其他好文   时间:2018-09-18 22:58:07    阅读次数:204
zoj 4057
#include #include #include #include #include #include using namespace std; #define ll long long const int N =1e5+9; int t,n,a[N]; int b[50]; /* 要想两个数的... ...
分类:其他好文   时间:2018-09-18 11:21:06    阅读次数:124
zoj 4056
At 0 second, the LED light is initially off. After BaoBao presses the button 2 times, the LED light turns on and the value of the counter changes to 1 ...
分类:其他好文   时间:2018-09-18 11:14:46    阅读次数:168
ZOJ 4053 Couleur
4053 思路: 主席树 先分别求前缀和后缀的逆序数 然后要求某一段的逆序数,就可以根据前缀或着后缀根据容斥求出答案, 这样需要枚举这一段中的数,求之前或者之后有多少个比他大或比他小的数, 这个可以通过用主席数维护权值线段树来做 然后每次枚举断开后小的那段区间,这样最多需要枚举n*log(n)次 复 ...
分类:其他好文   时间:2018-09-18 00:15:32    阅读次数:214
【bzoj5072】[Lydsy十月月赛]小A的树 树形背包dp
题解: 比较好想 首先注意到如果最暴力的做法复杂度无法接受 而5000的范围基本是n^2做法了 只使用已经遍历过的点数目和当前子树中的点数目转移我们知道复杂度是n^2的 于是大胆猜测一波同一个节点为根值域是连续的 然后就可以暴力dp了 查询的时候我们可以把序列差分一下(原问题等价于 区间修改,区间询 ...
分类:其他好文   时间:2018-09-17 00:01:35    阅读次数:295
【JZOJ5263】分手是祝愿
Description 请注意本题的数据范围。 Description 请注意本题的数据范围。 Description 请注意本题的数据范围。 请注意本题的数据范围。 Input Input Input Output Output Output Sample Input 2 2 15 19 3 30 ...
分类:其他好文   时间:2018-09-16 22:06:15    阅读次数:275
bzoj 1787: [Ahoi2008]Meet 紧急集合【树链剖分lca】
对于三个点求最小路径长度和,答案肯定在某两个点的lca上,因为如果把集合点定在公共lca上,一定有两个点汇合后再一起上到lca,这样显然不如让剩下的那个点下来 这个lca可能是深度最深的……但是我懒得证了,反正只有三个lca,每个都求一遍然后取个max就好啦 cpp include include ...
分类:其他好文   时间:2018-09-14 14:33:02    阅读次数:179
bzoj 1855 dp + 单调队列优化
思路:很容易写出dp方程,很容易看出能用单调队列优化。。 ...
分类:其他好文   时间:2018-09-10 15:36:20    阅读次数:215
bzoj 2750: [HAOI2012]Road【spfa+dfs】
枚举起点做spfa,然后一条边在最短路上的条件是dis[e[i].to]==dis[u]+e[i].va,所以每次spfa完之后,dfs出a[i]表示经过i点的最短路的起点数,b[i]表示经过i点的最短路的终点数,一条边(u,v)在当前起点下的答案就是a[u] b[v],最终答案是总和 因为最短路构 ...
分类:其他好文   时间:2018-09-08 16:00:23    阅读次数:166
3596条   上一页 1 ... 30 31 32 33 34 ... 360 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!