摘要: 题目传送门 分析:求最短路的题目,不需要把点标代号。 code: #include <bits/stdc++.h> using namespace std; #define File(x) freopen("(x)","r",stdin) #define pf printf #define ull 阅读全文
posted @ 2021-07-20 15:48 GUO_dx 阅读(47) 评论(0) 推荐(0)
摘要: 题目传送门 分析:总体走势肯定是b大致从小到大排序的,但是比如{0,1}和{1,2},会发现b={2,1}时更优 代码: #include<bits/stdc++.h> using namespace std; int a[10001]; double cal[1000001]; double ca 阅读全文
posted @ 2021-07-20 10:11 GUO_dx 阅读(67) 评论(0) 推荐(0)
摘要: ####分析: 假如是 \(A:1\ 5\) \(B:2\ 6\) 可知通过一次替换变成 \(A:1\ 2\) \(B:5\ 6\) $发现原来的$ans$是$(2-1)+(6-5)$,那么现在的$ans$变成$(5-1)+(6-2)$,和原$ans$相比,新的$ans$更大,因为把-5变+5,把+ 阅读全文
posted @ 2021-07-19 16:43 GUO_dx 阅读(65) 评论(0) 推荐(0)
摘要: 数位DP,到每个position时,都可以从这个position开始,也可以继承前面的数。 #include <bits/stdc++.h> using namespace std; #define File(x) freopen("(x)","r",stdin) #define pf printf 阅读全文
posted @ 2021-07-19 10:06 GUO_dx 阅读(46) 评论(0) 推荐(0)
摘要: 分析:BFS。由于管的型号已知,所以只要记录 x ,y 和进入该点的方向即可。 7.27_upd:从上进入是0,从左是1,从下2,从右3.这个type数组是用来计算转动角度的,比如type[0][2]意思是上一个格子从上进入,这一个格子从下进入。你会发现4*4种情况每一种情况都和一种管子一一对应(这 阅读全文
posted @ 2021-07-19 09:27 GUO_dx 阅读(129) 评论(3) 推荐(1)
摘要: 链接:https://ac.nowcoder.com/acm/contest/11166/A 来源:牛客网 (这是A题,其他的题目在我博客也有的) 打表: using namespace std; #define P pair<int,int> const int N=5e3+100; bitset 阅读全文
posted @ 2021-07-18 20:55 GUO_dx 阅读(122) 评论(0) 推荐(0)
摘要: 1- The Child and Sequence At the children's day, the child came to Picks's house, and messed his house up. Picks was angry at him. A lot of important 阅读全文
posted @ 2021-07-13 20:41 GUO_dx 阅读(48) 评论(0) 推荐(0)
摘要: \(w[i][j] * w[j][k] * .... * w[p][i]<1成立\) 考试要认真看题啊哥!你怎么自动认为p i 是 p l呢。。。。。 2. \(圆周上面有n个位置可以绑上细线,可以这样把n个位置两两连接,然后在这个圆上产生很多的交点。\) 就是$C(n,4)$。 。 3. CSU- 阅读全文
posted @ 2021-03-24 17:13 GUO_dx 阅读(38) 评论(0) 推荐(0)
摘要: C - The Tower of Babylon UVA - 437 排序 + dp,值得注意的是排序的方式。因为这个题目方块的三维具有可交换性,所以比较时和比较前的处理要理顺。 HDU 4857 反向建边+topo排序 ,注意题目要求的1,2,3的位置依次尽量靠前,这和字典序是不一样的。所以优先存 阅读全文
posted @ 2021-03-07 20:01 GUO_dx 阅读(47) 评论(0) 推荐(0)
摘要: 最小费用 最大流 我看了很久题解还是不会.等以后学好MCMF一定来写这道. c o d e #include<cstdio> #include<cstring> #include<algorithm> #define N 8010 #define M 10010 #define inf 0x3f3f 阅读全文
posted @ 2020-11-25 20:04 GUO_dx 阅读(51) 评论(0) 推荐(0)