自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(71)
  • 资源 (1)
  • 问答 (1)
  • 收藏
  • 关注

bzoj1152: [CTSC2006]歌唱王国Singleland

这。。是一题神题,我就不多说了,太神了(对于我来说) 太弱了,众神犇可望不可即 题解: 话说在前……有公式恐惧症的勿读此文……   用pow(a, b)代表a的b次方。 用Σ(a, b)代表条件为a,对b求和。 用|a|代表字符串a的长度。 用a . b代表数字串a和数字串b串联后的字符串。 而a + b代表数字串集合a与数字串集合b的并集。 数字a既可当数字a也可当只包括a...

2013-10-21 21:24:35 153

bzoj1151: [CTSC2007]动物园zoo

位压DP,就是五个位,表示第i个人看到的那5个动物的情况,最开始枚举有哪些动物走了,转移就很显然了 const int N = 100010, D = 31, M = 32; struct Node { int Start, Love, Afraid; inline void Read(int n) { int F, L, x; scanf("%d%d%d", &...

2013-10-21 21:19:54 239

bzoj1150: [CTSC2007]数据备份Backup

没处理一个元素,就要维护他旁边的差 const int N = 100010; typedef pair<LL, int> PLI; priority_queue<PLI, vector<PLI>, greater<PLI> > Q; int n, m; LL Dat[N]; int L[N], R[N]; bool Okay[N];...

2013-10-21 17:22:12 124

bzoj1149: [CTSC2007]风玲Mobiles

咳,这是道水题,我不想多说。。 太弱太弱,做了这么久   #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <ctime> #include <iostream> #include <al...

2013-10-21 16:57:29 101

bzoj1148: [CTSC2007]挂缀pendant

总的说,这道题目就是要求一个双关键字的最长序列,并让你数出来 关键字是给你的ci,wi 若我们按照ci+wi来进行排序,我们可以证明最有序列必然存在于这个排过序的序列中   证明: 我们令S[i]=W[1]+..+W[I] 若右移最有排列不是按照W[i]+C[i]排序,则必有 W[x]+C[x]>W[x+1]+C[x+1] 那他还能承受min{C[x]-S[x-1], C[...

2013-10-21 16:53:58 128

bzoj1145: [CTSC2008]图腾totem

http://hi.baidu.com/wjbzbmr/item/03de2de8d025eb07560f1dd0 设f(xxxx)表示排序xxx出现的数量。。那么我们要求的是f(1324)-f(1243)-f(1432)注意到f(1243)=f(12xx)-f(1234)。。这两个都很好求。。所以1243解决了。。但其他两个几乎不可做啊。。题目既然让我们相减,这两个式子必然是有所关联的。。f...

2013-10-16 10:01:08 155

bzoj1143: [CTSC2008]祭祀river

选出来的点只能是不能向流通的,所以就是从n个点的二分图(相连通的连边)里面,选出最大独立集 const int N = 110; int n, m; bool Graph[N][N], Okay[N]; int Disx[N], Disy[N], Que[N], Head, Tail; int Match[N], Vis[N]; inline void Input() { s...

2013-10-16 09:59:02 80

bzoj1103: [POI2007]大都市meg

利用dfs序的性质,使用树状数组统计 记录一下每个点进入dfs和退出dfs的时间,将进入的权值赋为1,退出的赋为-1,。每次修改公路,就把这两个值都修改为0,输出前缀和 const int N = 2500010; struct Edge { int V; Edge *Next; Edge() {} Edge(int _V, Edge *_Next) : V(_V),...

2013-10-16 09:56:37 108

bzoj1096: [ZJOI2007]仓库建设

《用单调性优化动态规划》 这个是分析,超详细 const int N = 1000010; const DB Eps = 0.000001; struct Node { int l, r, ch; Node() {} Node(int _l, int _r, int _ch) : l(_l), r(_r), ch(_ch) {} }; int C[N],...

2013-10-16 09:53:54 81

bzoj1095: [ZJOI2007]Hide 捉迷藏

树分治,我写的是点分治,把中心点拿出来,左右两边看成他的左右孩子就可以了,同时用堆维护,我偷懒用了priority_queue 我怎么调都wa,没办法以后再填坑吧 代码:no ...

2013-09-22 21:50:12 88

bzoj1093: [ZJOI2007]最大半连通子图

先缩点,重新建图,DP 就行了,类似于树形 DP,先求出从每个点出发,能走的最长链是多长,统计最长的那条就是最大半连通子图的点的数量 但是,超时,你妹,我也没办法   #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include &...

2013-09-22 21:47:03 90

bzoj1090: [SCOI2003]字符串折叠

同bzoj1068: [SCOI2007]压缩,一样的做法,思路,详解请看那篇文章 #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <ctime> #include <iostream> #inc...

2013-09-22 21:43:01 92

bzoj1089: [SCOI2003]严格n元树

题解:http://hi.baidu.com/gzh19950711/item/c3ac0f0b0ad3b0c190571881 超级详细,我就不说了 #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <ctime&g...

2013-09-22 21:41:26 87

bzoj1088: [SCOI2005]扫雷Mine

枚举第一个格子有无雷,O(n)检验 #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <ctime> #include <iostream> #include <algorithm>

2013-09-22 21:38:39 85

bzoj1087: [SCOI2005]互不侵犯King

状态压缩Dp,要与处理哪个可以转移到哪个 const int N = 10, K = 100, M = 1024; struct Edge { int V; Edge *Next; Edge() {} Edge(int _V, Edge *_Next) : V(_V), Next(_Next) {} } *Fir[M]; vector<int> State, ...

2013-09-10 21:45:17 88

bzoj1086: [SCOI2005]王室联邦

求强联通分块,让其变成一棵树,对于书上每一个点(强连通分量,其内部点数为权值),对于他每一个孩子,若>k就分成一个省,省会为该点,最后再加上该点的权值,若>k,分省,否则递归上去给父亲,最后出来要特殊处理 const int N = 1010; typedef vector<int> VI; struct Edge { int v; Edge *Next; ...

2013-09-10 21:43:38 68

bzoj1085: [SCOI2005]骑士精神

迭代加深搜索,枚举层数,估价函数就是当前状态与目标状态不同的个数,鉴于此题代码写得比较丑,不发了

2013-09-10 21:38:43 71

bzoj1084: [SCOI2005]最大子矩阵

m<=2,分m==1和m==2的情况讨论,,然后就是一道水DP题,转移见代码 const int N = 110; int n, m, k, dat[2][N]; int S[4][N]; int f[N][N] = {0}; inline void sol1() { For(i, 1, k) For(j, 1, n) { f[i][j] = f[i][j ...

2013-09-10 21:33:29 75

原创 bzoj1083: [SCOI2005]繁忙的都市

第一问n-1无疑 第二问最小生成树kruskal(不知道有没有算错)算法的改进版 const int N = 310, M = 90010; struct Edge { int u, v, Val; inline bool operator <(const Edge &B) const { return Val < B.Val; } //friend bo...

2013-09-10 21:31:23 94

bzoj1082: [SCOI2005]栅栏

这里有题解:http://blog.sina.com.cn/s/blog_8442ec3b01017ks5.html   请看神剪枝   二分能够得到多少木板,然后用Dfs验证能否全部得到1..mid这些木块。 这样会有1个点过不了。 这道题加一个优化:如果当前这个木块和前一个木块相同(倒着枚举小木块),那么搜大木块的时候就从当前这个大木块开始,具体看代码。  由于这是USACO题...

2013-09-09 16:49:56 73

bzoj1081: [SCOI2005]超级格雷码

水题,大水题,只不过bzoj上没有设special judge,WA了几次 const int N = 20; int Dat[N], Base[N], Sum; int n, m; inline void Input() { scanf("%d%d", &n, &m); Sum = 1; Rep(i, n) Sum *= m, Base[i] = 1; ...

2013-09-09 16:47:26 74

bzoj1080: [SCOI2008]劣质编码

正解我不太懂,最后使用clj的神暴力水过去了,总而言之我还是太弱了 typedef vector<int> VI; const int N = 40; map<VI, int> Hash; queue<VI> Q; int n; string Dat[N]; inline void Input() { scanf("%d", &n...

2013-09-09 16:45:27 133

bzoj1079: [SCOI2008]着色方案

我写的是状态压缩DP(其实没有必要),所有的燃料其实都可以按照能够染多少格子来划分种类,那至多只有5种染料,马上状压(也不算状压,记忆化搜索吧) const int N = 20, Mod = 1000000007; map<int, int> Dp; map<int, bool> Vis; int n, Dat[6], St, Base[6]; inlin...

2013-09-09 16:43:16 93

原创 bzoj1078: [SCOI2008]斜堆

非常详细,我就不写了 传送门:http://www.cppblog.com/MatoNo1/archive/2012/10/07/192131.html const int N = 60; struct Node { int V, Lc, Rc, Size, C[N]; } Tr[N]; int n; int L[N], R[N], C[N]; inline void I...

2013-09-09 16:39:43 99

bzoj1077: [SCOI2008]天平

恶心题,代码完全抄袭某神,请无视 const int N = 60; struct Edge { int v; Edge *next; Edge(int v, Edge* next) : v(v), next(next){} } *Fir1[N], *Fir2[N]; int A, B, n; char Dat[N][N]; int Fa[N]; int Ans1, A...

2013-09-08 16:16:49 64

bzoj1076: [SCOI2008]奖励关

倒推期望Dp const int N = 16, M = 110; int Need[N], n, k; DB Dat[N], Dp[M][1 << N]; inline void Input() { scanf("%d%d", &k, &n); Rep(i, n) { int x; Need[i] = 0; scanf("%l...

2013-09-08 16:14:51 79

bzoj1075: [SCOI2007]最优驾车drive

这个就是个爆搜+剪枝 1.预处理每个点到终点的最快时间和最慢时间,最快到达都比t2慢,或者最慢到达都比t1快,此时剪枝。 2.Hash判重 3.如果当前时间加上最快到终点时间、当前油量加上到终点所需的最少油量都不如已经搜到的答案优,剪枝。 这样就可以开开心心AC了 const int N = 15; const DB Eps = 1e-8; struct State { int...

2013-09-08 16:13:20 131

原创 bzoj1074: [SCOI2007]折纸origami

从后往前逆推 const int N = 10; struct Point { DB Ox, Oy; Point(){} Point(DB _Ox, DB _Oy) : Ox(_Ox), Oy(_Oy) {} friend Point operator -(Point a, Point b) { return Point(a.Ox-b.Ox, a.Oy-b.Oy); } ...

2013-09-08 16:10:37 131

bzoj1073: [SCOI2007]kshort

擦,栈溢出 这个做法么,就是明显的二分+爆搜验证取最优解了 // please forgive my foolish, I Cheat the last two points const int N = 60; typedef pair<int, int> II; vector<II> E[N], Back[N]; int n, m, Kth, S, T; ...

2013-09-08 16:10:00 123

bzoj1072: [SCOI2007]排列perm

分半搜索,枚举那几个数字分成两半的方案,然后暴力看它们组合Mod d 的余数,并记录,left[i]表示左边的有多少组合mod d = i ,right[i] 也相同,然后用简单数学方法合并 const int N = 15, M = 1010; int Dat[N], TDat[N], Cnt[2][M], Ans; int n, Mod; char S[N]; inline v...

2013-09-02 13:34:17 70

bzoj1071: [SCOI2007]组队

利用单调性+堆+乱搞即可 const int N = 5010; struct Node { int Speed, Height, Val; friend bool operator <(Node A, Node B) { return A.Val < B.Val; } } Dat[N]; priority_queue<Node> Q; int n, A...

2013-09-02 13:30:22 58

bzoj1070: [SCOI2007]修车

网络流,将维修人员拆成N个,记为P(i,j),然后每辆车对P(i,j)连一条容量为1,权为j*time[i][j]的边,表示让第i个维修人员在倒数第j的位置修这辆车,于是会导到剩下的所有人多等j*time[i][j]的时间 const int N = 700; struct Edge { int V, Val, Cost; Edge *Next, *Pair; Edge() {}...

2013-09-02 13:29:07 74

bzoj1069: [SCOI2007]最大土地面积

1、O(N^2)地枚举对角线。 2、分别求出这条对角线左右两侧到这条线段所在直线距离最大的点,记为l、r,相当于求出以这条对角线为底、左右两侧分别高最大(面积最大)的三角形。 3、对于枚举的每条对角线,计算四边形面积并更新答案。 这样的时间复杂度是O(N^3)的,不能承受,一个优化就是,可以证明:如果按照逆时针顺序存储凸包,那么对于对角线(i,j+1),与之相对应的l、r分别在对角线(i,...

2013-09-02 13:27:24 110

原创 bzoj1068: [SCOI2007]压缩

状态定义是(l,r,t)表示l到r的字串,t表示中间能否放M,注意最开始有个M const int N = 60; char Dat[N]; int Dp[N][N][2]; bool Vis[N][N][2]; inline void Input() { scanf("%s", Dat + 1); } inline bool Match(int A, int B) ...

2013-09-02 13:24:49 74

bzoj1067: [SCOI2007]降雨量

最水最水最水的一道题目, 完全不需要多说   const int N = 50010, D = 17; struct Node { int Year, Water; Node() {} Node(int _Year, int _Water) : Year(_Year), Water(_Water) {} } Dat[N]; int Dp[D][N]; int n, m; ...

2013-08-29 15:05:55 89

bzoj1066: [SCOI2007]蜥蜴

每个点(i,j),(i,j)→(i,j)'连上容量为h[i][j]的边。(i,j)为入点。(i,j)'为出点 对于所有有蜥蜴的点,从S给它连一条容量为1的边。对于所有可以跳到外面的点,连到T,容量是h[i][j]。 网络流跑一遍 const int N = 30; struct Point { int Ox, Oy, H; Point() {} Point(int _Ox, ...

2013-08-29 15:04:52 60

bzoj1065: [NOI2008]奥运物流

传送门:http://blog.csdn.net/whjpji/article/details/7593329 const int N = 70; int Fa[N], n, m; DB Dp[N][N][N], S[N][N][N]; DB C[N], F[N], K[N], Ans; inline void Input() { scanf("%d%d%lf", &n...

2013-08-29 14:16:10 118

bzoj1064: [Noi2008]假面舞会

传送门:http://blog.sina.com.cn/s/blog_86942b1401015r81.html   const int N = 100010, M = 1000010; struct Edge { int V, Val; Edge *Next; Edge() {} Edge(int _V, int _Val, Edge *_Next) : V(_V), V...

2013-08-29 14:13:57 53

原创 bzoj1063: [Noi2008]道路设计

再来一道神题 题解传送门:https://www.byvoid.com/blog/noi-2008-design/ const int N = 100010; struct Edge { int V; Edge *Next; Edge() {} Edge(int _V, Edge *_Next) : V(_V), Next(_Next) {} } *Fir[N]; i...

2013-08-29 14:11:49 86

bzoj1062: [NOI2008]糖果雨

又是一道神题 题解传送门:http://blog.sina.com.cn/s/blog_86942b1401015yln.html 代码完全抄袭某神,请无视掉 const int N = 1010, M = 1000010; struct Dat { int t, p; } Dat[M]; int C1[N * 3][N << 2], C2[N * 3][N <...

2013-08-27 15:17:01 138

1999的国家集训队的论文

1999的国家集训队的论文,论文以及配件齐全

2014-02-17

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除