该文被密码保护。 阅读全文
posted @ 2017-09-11 22:16 Alex丶Baker 阅读(24) 评论(1) 推荐(0) 编辑
摘要: 167. [USACO Mar07] 月度花费 二分答案 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define maxn 1000000 4 int n,m,minn,maxx; 5 int a[maxn]; 6 7 bool chec 阅读全文
posted @ 2017-09-11 22:11 Alex丶Baker 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(92) 评论(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 阅读(101) 评论(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) 编辑