上一页 1 2 3 4 5 6 ··· 44 下一页
摘要: 新学的,其实吧,就那么回事....看了几天,splay处理序列问题,真的非常厉害,翻转,插入,删除,线段树实现不了的功能,splay用起来很方便。POJ 3580 SuperMemo这题基本就是检验模板的题,各种操作都有,错了好多次,发现以前写的代码有错了的,数据水点,给水过了,注意pushup。S... 阅读全文
posted @ 2014-06-12 16:48 Naix_x 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 感觉线段树一直学的不好,从开始学到现在换了很多风格,模板其实不是问题,关键是还是思路吧。从水题,开始再来一遍。HDU 1166 敌兵步阵#include #include #include #include #include #include #include using namespace std... 阅读全文
posted @ 2014-05-22 19:06 Naix_x 阅读(415) 评论(0) 推荐(1) 编辑
摘要: 这是第三次参加省赛了,每次感觉都很特别,这次也应该是最后一次了... 能参加也是非常的幸运,很有大一时候的感觉,比赛发挥的不好,这是我的错... 第一次这么多人一起出去比赛,感觉很棒,在火车上成功的教会了scf打三国杀,我想问一下,你打牌为什么老杀我!!不对,是你们打牌,为什么老杀我....... 阅读全文
posted @ 2014-05-15 17:18 Naix_x 阅读(222) 评论(0) 推荐(0) 编辑
摘要: ZOJ3430 Detect the Virus挺扯的一个题,解码有点问题+注意用int存,跟HDU2222差不多...#include #include #include #include #include #include using namespace std;#define N 60010i... 阅读全文
posted @ 2014-05-14 21:48 Naix_x 阅读(255) 评论(0) 推荐(0) 编辑
摘要: POJ 3744Scout YYF I这就是一个乱搞题,暴力发现TLE了,然后看了看discuss里说可以矩阵加速,想了一会才想明白怎么用矩阵,分着算的啊。先算f[num[i]-1]之类的,代码太长了,还是找找规律吧。。#include #include #include #include #inc... 阅读全文
posted @ 2014-05-12 15:51 Naix_x 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 题目链接建个图,套个模板。#include #include #include #include #include #include #include #include using namespace std;#define INF 0x3ffffffstruct node{ int u,v,... 阅读全文
posted @ 2014-05-07 16:11 Naix_x 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 题目链接模板题。#include #include #include #include #include #include #include using namespace std;int p[101][101],mat[101][101];int t;void qmod(int n,int MOD... 阅读全文
posted @ 2014-05-07 09:49 Naix_x 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 题目链接错的上头了...这题是DNA的加强版,26^1 +26^2... - A^1-A^2...先去学了矩阵的等比数列求和,学的是第二种方法,扩大矩阵的方法。剩下就是各种模板,各种套。#include #include #include #include #include #include #in... 阅读全文
posted @ 2014-05-06 21:15 Naix_x 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 题目链接暴力出来,竟然眼花了以为sg(i) = i啊....看表要认真啊!!!#include #include #include using namespace std;#define LL __int64int dp[10001];int sg(int x){ int flag[10001... 阅读全文
posted @ 2014-05-05 09:45 Naix_x 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 题目链接食物链类似的题,主要是在于转化,a-b的和为s,转换为b比a-1大s。然后并查集存 此节点到根的差。假如x的根为a,y的根为b:b - y = rank[y]a - x = rank[x]y - x = s可以推出b - a = rank[y] - rank[x] + s;并查集 延迟更新什... 阅读全文
posted @ 2014-05-05 07:59 Naix_x 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 题目链接再水一发,构造啊,初始化啊。。。wa很多次啊。。#include #include #include #include #include #include #include using namespace std;#define MOD 1000000007#define LL long l... 阅读全文
posted @ 2014-05-03 01:18 Naix_x 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 题目链接构造矩阵 看的题解,剩下的就是模板了,好久没写过了,注意取余。#include #include #include #include #include #include #include using namespace std;#define MOD 10007#define LL __in... 阅读全文
posted @ 2014-05-02 16:31 Naix_x 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 题目链接模板题吧,忘了好多,终于A了...#include #include #include #include #include #include #include using namespace std;#define maxn 1000000#define lson l,m,rt>1; ... 阅读全文
posted @ 2014-05-02 14:58 Naix_x 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 非常棒的组合问题,看了好一会,无想法....有很多做法,我发现不考虑顺序的最好理解,也最好写。结果一定是两种形式A....A dp[n-1]A...A...A sgma(dp[j]*dp[n-j-1])( 1<=j<=n-2)最后乘上n!什么时候才能自己在比赛中做出一个500分来啊!!!class... 阅读全文
posted @ 2014-05-02 13:44 Naix_x 阅读(182) 评论(2) 推荐(0) 编辑
摘要: D题并查集+组合#include #include #include using namespace std;#define MOD 1000000007int o[2001];int find(int x){ int t,r; t = x; while(x != o[x]) ... 阅读全文
posted @ 2014-04-23 21:59 Naix_x 阅读(172) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 44 下一页