上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 50 下一页
摘要: 题目: 补半年前的题=_= 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn=1e5+10; 4 5 map<int,int> mp; 6 int L[maxn],R[maxn],val[maxn]; 7 int c 阅读全文
posted @ 2017-08-25 21:41 yijiull 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Two strings HDU - 6170 题意:给两个串s和p,问是否能匹配。其中p里面有两个特殊字符,'.'可以匹配任意字符,'*'可以让前一个字符出现任意次。 dp~ 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 const in 阅读全文
posted @ 2017-08-25 15:48 yijiull 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Just do it HDU - 6129 题意:给出n个元素的数组a,让你异或m次得到新的数组b。 每一次得到的b[i]都是a[0]一直异或到a[i],然后把b赋值给a,循环m次得到b。 碰到异或的题,一定要考虑很重要的一个性质,a^b^b==a !! 就是说异或偶数次同一个数之后值不变! 对于这 阅读全文
posted @ 2017-08-25 13:58 yijiull 阅读(201) 评论(0) 推荐(1) 编辑
摘要: 843C - Upgrading Tree 题意:给一棵n个点的树,允许不超过2*n次操作。操作:(x,y,z),删除边(x,y),添加边(y,x),要求满足三个条件(见原题) 题解: 待补~ 先贴上dalao代码: 1 #include <bits/stdc++.h> 2 3 using name 阅读全文
posted @ 2017-08-25 11:08 yijiull 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 843B - Interactive LowerBound 有点懵比~~ 没看懂题解说的随机数概率什么的=_= 先贴上dalao代码 1 #include <bits/stdc++.h> 2 3 using namespace std; 4 5 inline pair <int, int> ask( 阅读全文
posted @ 2017-08-25 10:44 yijiull 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 843A - Sorting by Subsequences 还好之前了解过一点白书上的permutation! 我写的递归,其实很容易直接写成递推啊 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn=1e5+10; 阅读全文
posted @ 2017-08-25 10:00 yijiull 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 844B - Rectangles 最多有2^50*2个!! 我也用long long 了,可是移位的时候忘记了,导致溢出,然后一早起来发现被hack了=_=|| 1<<temp; 1LL<<temp; 1 #include <bits/stdc++.h> 2 using namespace std 阅读全文
posted @ 2017-08-25 09:45 yijiull 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 724G - Xor-matic Number of the Graph 题意: 待补~~ 参考http://www.cnblogs.com/ljh2000-jump/p/6443189.html 阅读全文
posted @ 2017-08-24 22:40 yijiull 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Xor HYSBZ - 2115 题意:给一个树,求1到n的最长路径。这里的路径定义为异或和。 线性基~~ 1 #include <bits/stdc++.h> 2 using namespace std; 3 #define ll long long 4 struct LiBase{ 5 ll a 阅读全文
posted @ 2017-08-24 22:04 yijiull 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 845G - Shortest Path Problem? 题意:给一个树,求1到n的最短路径。这里的路径定义为异或和。 线性基~ 1 #include <bits/stdc++.h> 2 using namespace std; 3 #define ll long long 4 struct Li 阅读全文
posted @ 2017-08-24 22:02 yijiull 阅读(230) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 50 下一页