摘要: 这题题解dp不懂 因为不知道它怎么记录dp的答案的 字符串那么长 我是贪心过得,当时还被四个人hack,都没成功,hhhhh 大意就是优先从头取字典序小的字母,担也要让后面不管怎么取都合法 #include<bits/stdc++.h> using namespace std; const int 阅读全文
posted @ 2016-09-25 09:30 basasuya 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 这题惩罚我这种经常不管常数的懒人 直接 1e6 TLE 如果1e5对数组枚举过 诶其实很想吐槽些伤心事,但是还是不想在博客上吐口水 不管今年比赛结果如何 请享受比赛 #include<bits/stdc++.h> using namespace std; const int INF = 0x3f3f 阅读全文
posted @ 2016-09-25 00:07 basasuya 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 神他妈随便写写就能过… 暴力枚举每个取不取 两个剪纸: 1.当剩下可用的时间小于最少需要用的时间 跳出 2.当剩下的植物按照理想情况(甚至可以取一部分)得到的极限答案比已经求出的答案大 跳出 #include<bits/stdc++.h> using namespace std; const int 阅读全文
posted @ 2016-09-23 00:03 basasuya 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 简单说就是左边x,y按照奇偶分为四种对于答案的影响都是不相关的 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 1e3+5; int N,M; ll tree[4][MAXN][M 阅读全文
posted @ 2016-09-22 20:04 basasuya 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 裸的树链剖分加线段树区间修改 区间合并时需要多注意一点 当时写的很慢 理解不深刻 #include<bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; const int MAXN = 40005; #define lson 阅读全文
posted @ 2016-09-22 18:10 basasuya 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 我对于题目的一种理解 改造农场 1.建新农场 在空的点选 2.重建旧农场 选一个点属于这个农场的地方都要选 最后的农场都不能相连 所以枚举旧农场的个数并进行二分图匹配 #include<bits/stdc++.h> using namespace std; int N,M; char mp[12][ 阅读全文
posted @ 2016-09-21 20:26 basasuya 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 基本思路就是二分 每条边分别二分求 c++11 用fflush(sdtout) 不行 囧啊 #include<bits/stdc++.h> using namespace std; int ans[2][4]; int inp; int check(int x1,int y1,int x2,int 阅读全文
posted @ 2016-09-16 17:29 basasuya 阅读(180) 评论(0) 推荐(0) 编辑
摘要: dp题 并运用了前缀和 我看题目提示中有fft 我想了下感觉复杂度不过关还是未解 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 4e5+5; const int MOD = 1e 阅读全文
posted @ 2016-09-13 18:04 basasuya 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 这个题解错了网上还没有题解 囧 fi = (i%2)? 1 : -1 Fn = (n+m−1m−1) - ∑ni=0 ∑m−1j=1 (n−i∗(j+1)+m−2 m−2) * (m−1 j)*fj Fn *= m #include<bits/stdc++.h> using namespace st 阅读全文
posted @ 2016-09-13 15:06 basasuya 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 树的点分治 感觉理解的不够深刻 等想好再多写点 #include <iostream> #include <queue> #include <stack> #include <map> #include <set> #include <bitset> #include <cstdio> #inclu 阅读全文
posted @ 2016-09-04 11:55 basasuya 阅读(106) 评论(0) 推荐(0) 编辑