上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 24 下一页
摘要: 假装自己打比赛嘿嘿嘿 1 #include <bits/stdc++.h> 2 using namespace std; 3 int t,n,d,a[100010]; 4 int main(){ 5 for(cin>>t;t--;){ 6 cin>>n>>d; 7 for(int i=1;i<=n; 阅读全文
posted @ 2020-02-18 20:43 墨鳌 阅读(213) 评论(0) 推荐(0) 编辑
摘要: POJ 2234 Matches Game HOJ 4388 Stone Game II POJ 2975 Nim HOJ 1367 A Stone Game POJ 2505 A multiplication game ZJU 3057 beans game POJ 1067 取石子游戏 POJ 阅读全文
posted @ 2020-02-18 13:54 墨鳌 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 开O2,开O2,开O2 重要的事情说三遍 1 #include <set> 2 #include <map> 3 #include <cmath> 4 #include <queue> 5 #include <vector> 6 #include <cstdio> 7 #include <cstdl 阅读全文
posted @ 2020-02-17 19:37 墨鳌 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 直径定义:树上的最长路径,不妨设端点分别为s,t 可以证明(感觉):每个点到其最远点必定为s or t,反之亦然 首先,第一次dfs找到s 然后,第二次dfs以s为根找到t 最后,第三次dfs以t为根 比较二三两次的当前点深度可得到答案 1 #include <set> 2 #include <ma 阅读全文
posted @ 2020-02-16 22:18 墨鳌 阅读(343) 评论(0) 推荐(0) 编辑
摘要: 1 #include <set> 2 #include <map> 3 #include <cmath> 4 #include <queue> 5 #include <vector> 6 #include <cstdio> 7 #include <cstdlib> 8 #include <cstri 阅读全文
posted @ 2020-02-15 15:58 墨鳌 阅读(149) 评论(0) 推荐(0) 编辑
摘要: int find(int x){return fa[x]==x?x:fa[x]=find(fa[x]);} #include <set> #include <map> #include <cmath> #include <queue> #include <vector> #include <cstd 阅读全文
posted @ 2020-02-14 23:30 墨鳌 阅读(124) 评论(0) 推荐(0) 编辑
摘要: https://github.com/twilightgod/twilight-poj-solution 阅读全文
posted @ 2020-02-13 20:40 墨鳌 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 错误AC解法,sort+set判重,为考虑异构! 比较坑的一点是读入时scanf一定要一次读6个数,不然会TLE #include <set> #include <map> #include <cmath> #include <queue> #include <vector> #include <c 阅读全文
posted @ 2020-02-13 18:20 墨鳌 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 不是很懂? 胡乱hash 1 #include <set> 2 #include <map> 3 #include <cmath> 4 #include <queue> 5 #include <vector> 6 #include <cstdio> 7 #include <cstdlib> 8 #i 阅读全文
posted @ 2020-02-12 20:53 墨鳌 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 哈个希加挂个链表 一个要背的字符串hash函数ELFhash() mod数取数据最大容量的1.5倍最佳?! 1 #include <set> 2 #include <map> 3 #include <cmath> 4 #include <queue> 5 #include <vector> 6 #i 阅读全文
posted @ 2020-02-12 00:26 墨鳌 阅读(177) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 24 下一页