上一页 1 2 3 4 5 6 7 ··· 16 下一页
摘要: P2038 无线网络发射器选址 注意边界是否小于0 1 #include<bits/stdc++.h> 2 using namespace std; 3 int d,n,num[1000][1000],ans[1000][1000],tot,cnt,maxx; 4 int main() 5 { 6 阅读全文
posted @ 2017-09-11 19:32 Alex丶Baker 阅读(158) 评论(1) 推荐(0) 编辑
摘要: 14. [网络流24题] 搭配飞行员 建边的时候要先从源点向主飞行员和从副飞行员向汇点连边 输入的时候只在两人之间连边 1 #include<cstdio> 2 #include<algorithm> 3 using namespace std; 4 #define maxn 10000 5 #de 阅读全文
posted @ 2017-09-11 18:05 Alex丶Baker 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 青蛙的约会 exgcd 1 #include<cstdio> 2 #include<iostream> 3 #define LL long long 4 using namespace std; 5 6 LL x,y,n,m,l; 7 8 LL exgcd(LL a,LL b,LL &x,LL &y 阅读全文
posted @ 2017-09-11 15:41 Alex丶Baker 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 爱在心中 tarjan缩点 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define maxn 1000000 4 int n,m,x,y,z,num,low[maxn],tim,cnt,q[maxn],t,ta,a[maxn]; 5 in 阅读全文
posted @ 2017-09-11 15:11 Alex丶Baker 阅读(77) 评论(0) 推荐(0) 编辑
摘要: P2912 [USACO08OCT]牧场散步Pasture Walking lca 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define maxn 1000000 4 int n,num,m,x,y,z,head[maxn],q,siz 阅读全文
posted @ 2017-09-11 14:34 Alex丶Baker 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 1503 愚蠢的宠物 1 #include<iostream> 2 #include<algorithm> 3 #include<cstring> 4 using namespace std; 5 6 #define maxn 1000000+100 7 int father[maxn]; 8 in 阅读全文
posted @ 2017-09-11 11:50 Alex丶Baker 阅读(117) 评论(0) 推荐(0) 编辑
摘要: P1432 倒水问题 A一直往B里倒 和 B一直往A里倒 取一个步骤较小的方案 输出涨姿势了 1 #include<bits/stdc++.h> 2 using namespace std; 3 int ca,cb,n,l1,l2; 4 5 int main() 6 { 7 while(scanf( 阅读全文
posted @ 2017-09-11 09:11 Alex丶Baker 阅读(184) 评论(0) 推荐(0) 编辑
摘要: P2652 同花顺 求出已有的序列中 最长的同花顺 然后用n减去这个长度 以牌的花色为第一关键字排序,不然会wa 排序之后要判重,因为有花色和大小都一样的牌 然后 枚举每张牌,以这张牌为它以前的区间的右端点,再枚举左端点,就可以了 1 #include<bits/stdc++.h> 2 using 阅读全文
posted @ 2017-09-11 08:12 Alex丶Baker 阅读(125) 评论(0) 推荐(0) 编辑
摘要: P1041 传染病控制 dfs枚举去掉的子树,更新当前感染节点 emmmm 这个题,每次去掉最大的子树的做法是错误的 比如 hhh,按照那个贪心的思路肯定是先去掉左边的子树,这样答案会是4 但是先去掉右边的子树的话答案就是3 1 #include<bits/stdc++.h> 2 using nam 阅读全文
posted @ 2017-09-10 10:03 Alex丶Baker 阅读(263) 评论(0) 推荐(0) 编辑
摘要: P2668 斗地主 统计单牌和对牌的数量 然后 凑顺子,能凑就凑 还有四带balabala和三带balabala 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n,t,s[15],ans,a,b; 4 5 inline void rea 阅读全文
posted @ 2017-09-09 21:22 Alex丶Baker 阅读(104) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 16 下一页