上一页 1 ··· 7 8 9 10 11 12 13 14 下一页
摘要: 练手QAQ#include#include#include#include#include#includeusing namespace std;void setIO(const string& a) { freopen((a+".in").c_str(), "r", stdin); f... 阅读全文
posted @ 2015-11-20 18:08 Showson 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 赛后填坑系列QAQ贴代码呀 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 8 using namespace std; 9 10 void setIO(const string& a) {... 阅读全文
posted @ 2015-11-20 10:27 Showson 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 一开始以为直接算联通块个数就行了后来发现还得分联通块里的奇点。。。还要注意m = 0的情况... 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 8 using namespace std; 9 10 void... 阅读全文
posted @ 2015-11-19 19:22 Showson 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 嗯 贴下代码 方便以后来看 treap : tyvj 普通平衡树 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 #include<cstdlib> 5 #include<cstring> 6 #include<stri 阅读全文
posted @ 2015-11-18 10:37 Showson 阅读(452) 评论(2) 推荐(0) 编辑
摘要: 留坑宇宙蘑菇(mushroom)【问题描述】 小m在宇宙中发现了一种奇怪的蘑菇,他每天都会固定分裂一次,长度为x的蘑菇回分裂成两个长度为x-1和x+1的蘑菇,但长度为0的蘑菇是不存在的,所以长度为1的蘑菇只能生成长度为2的蘑菇。 现在小m第一天有一个长度为2的蘑菇,他想知道第n天他有多少个蘑菇... 阅读全文
posted @ 2015-10-14 19:44 Showson 阅读(413) 评论(0) 推荐(0) 编辑
摘要: 做法是求逆拓扑序中字典序最大的将其反转则得到答案,粗略理解为对于每个数,把能把比大的能够放在他右边的都放在了右边,所以答案最优。留坑在此数据太水第一次du没清零都过了? 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include... 阅读全文
posted @ 2015-07-29 21:19 Showson 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 昨天讲课的时候突然想起来LIS还有一个东西没搞懂。又去研究了下。LIS问题就是要求一个序列中最长不下降或上升子序列,而此问题应用较广,例如很多题会有这样的条件对于i,j如果他们可以同时选取,则必有|a[i]-a[j]| = a[j]-b[j]…………①,a[i]+b[i] s[ans])s[++an... 阅读全文
posted @ 2015-07-22 09:15 Showson 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 为了彻底理解树状数组,试着用树状数组做了下普通平衡树而树状数组只能离线做,或者保证值的大小在数组可承受的范围内也是可以的,因为要求离线是因为必须事前对所有数离散化。然后我们看刘汝佳蓝书上的图利用如下代码,可以找到所有前缀和中第一个大于等于k的1 int kth(int k) {2 int a... 阅读全文
posted @ 2015-07-21 22:07 Showson 阅读(674) 评论(0) 推荐(1) 编辑
摘要: hzwer上少有的几道需要建一下模的 要不是有这么几道题 我都觉得lct只会考裸题了呢题解看hzwer吧http://hzwer.com/4358.html唯一蛋疼的就是为了处理0这个呵呵的位置,和严格小于,我把ntr数组全部+2,然后l+1,这样建树的时候就要写m+2了= =好蛋疼 1 #inc... 阅读全文
posted @ 2015-07-21 21:41 Showson 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 又是lct裸题(据说暴力能过?)写着略蛋疼 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 const int Maxn=200010; 10 11 int... 阅读全文
posted @ 2015-07-20 22:07 Showson 阅读(202) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 下一页