会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
shuguangzw
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
4
5
6
7
8
9
10
11
12
···
30
下一页
2016年6月25日
codeforces 682C Alyona and the Tree DFS
摘要: 这个题就是在dfs的过程中记录到根的前缀和,以及前缀和的最小值 #include <cstdio> #include <iostream> #include <ctime> #include <vector> #include <cmath> #include <map> #include <sta
阅读全文
posted @ 2016-06-25 08:33 shuguangzw
阅读(234)
评论(0)
推荐(0)
2016年6月24日
codeforces 681D Gifts by the List dfs+构造
摘要: 题意:给你一个森林,表示其祖先关系(自己也是自己的祖先),每个人有一个礼物(要送给这个人的固定的一个祖先) 让你构造一个序列,使得的对于每个人,这个序列中第一个出现的他的祖先,是他要送礼物的的那个祖先 分析:这个序列满足 1:我们这个序列只需要出现那些被送礼物的人就好了 2:这个序列的元素保证,如果
阅读全文
posted @ 2016-06-24 15:36 shuguangzw
阅读(281)
评论(0)
推荐(0)
2016年6月23日
codeforces 678E Another Sith Tournament 概率dp
摘要: 奉上官方题解 然后直接写的记忆化搜索 #include <cstdio> #include <iostream> #include <ctime> #include <vector> #include <cmath> #include <map> #include <queue> #include
阅读全文
posted @ 2016-06-23 17:16 shuguangzw
阅读(277)
评论(0)
推荐(0)
2016年6月22日
codeforces 680E Bear and Square Grid 巧妙暴力
摘要: 这个题是个想法题 先预处理连通块,然后需要用到一种巧妙暴力,即0变1,1变0,一列列添加删除 复杂度O(n^3) #include <cstdio> #include <iostream> #include <ctime> #include <vector> #include <cmath> #in
阅读全文
posted @ 2016-06-22 21:42 shuguangzw
阅读(232)
评论(0)
推荐(0)
codeforces 678D Iterated Linear Function 矩阵快速幂
摘要: 矩阵快速幂的题要多做 由题可得 g[n]=A*g[n-1]+B 所以构造矩阵 { g[n] } = {A B} * { g[n-1]} { 1 } {0 1} { 1 } 然后矩阵快速幂就好 矩阵快速幂的题要多做,多构造矩阵 注:其实这个题可以直接等比数列求求和,单数矩阵快速幂对于这类题更具有普遍性
阅读全文
posted @ 2016-06-22 21:36 shuguangzw
阅读(212)
评论(0)
推荐(0)
2016年6月19日
codeforces 679A Bear and Prime 100 交互
摘要: 第一次交互题,记录一下吧 #include <cstdio> #include <iostream> #include <ctime> #include <vector> #include <cmath> #include <map> #include <queue> #include <algor
阅读全文
posted @ 2016-06-19 21:03 shuguangzw
阅读(174)
评论(0)
推荐(0)
2016年6月18日
XTUOJ 1248 TC or CF 搜索
摘要: 这个题一眼看上去不会 然后有人说是网络流 然后我就想怎么建图啊,然后不会(是本蒟蒻太垃圾了),肯定有网络流解法 然后去群里问了gdut的巨巨,他说他队友爆搜+剪枝过了(我也是非常的叹服) 然后我也写了一个2^50的搜索剪枝,居然真过了(不知道是数据弱还是大力出奇迹) #include <cstdio
阅读全文
posted @ 2016-06-18 21:29 shuguangzw
阅读(280)
评论(0)
推荐(0)
XTUOJ1247 Pair-Pair 预处理+暴力
摘要: 分析:开个1000*1000的数组,预处理矩阵和,然后分类讨论就好 时间复杂度:O(n) #include <cstdio> #include <iostream> #include <ctime> #include <vector> #include <cmath> #include <map>
阅读全文
posted @ 2016-06-18 09:42 shuguangzw
阅读(182)
评论(0)
推荐(0)
XTUOJ1250 Super Fast Fourier Transform 暴力
摘要: 分析:因为加起来不超过1e6,所以最多有1000+个不同的数 做法:离散化搞就好了 #include <cstdio> #include <iostream> #include <ctime> #include <vector> #include <cmath> #include <map> #in
阅读全文
posted @ 2016-06-18 09:40 shuguangzw
阅读(227)
评论(0)
推荐(0)
2016年6月16日
XTUOJ 1246 Heartstone 贪心
摘要: 题意:挺好懂得 分析:先计算出如果不能用(减2)操作,至少需要多少个(减3)操作,这个很好计算 然后就是尽量多的去减少(减3)操作,肯定先抹平 余2 和 余1 的,然后就可以了 #include <cstdio> #include <iostream> #include <ctime> #inclu
阅读全文
posted @ 2016-06-16 10:37 shuguangzw
阅读(198)
评论(0)
推荐(0)
上一页
1
···
4
5
6
7
8
9
10
11
12
···
30
下一页
公告