Greg

CF295B Greg and Graph 题解 floyd性质题

题目链接:https://codeforces.com/problemset/problem/295/B 题目描述可参见 洛谷 解题思路完全来自 aiiYuu巨佬的博客 一道很好地利用了 floyd 算法性质的题目。 floyd算法 示例程序: #include <bits/stdc++.h> us ......
题解 性质 Graph floyd 295B

CF98C Help Greg the Dwarf 题解

# CF98C Help Greg the Dwarf 题解 ~~为什么不三分~~? 首先我们考虑如何求出答案。 如图,考虑设夹角为 $\theta$,那么可以得到表达式: $$ [\cfrac a {\tan \theta} - (l \cos \theta - b)] \sin \theta $ ......
题解 Dwarf Help Greg 98C

重做 CF 295B Greg and Graph 以及理解 Floyd

# Floyd 原理简析 Floyd 的原理其实是 DP,定义 $\mathrm{dp}[S][i][j]$ 表示在仅经过点集 $S$ 里的点的条件下,从 $i$ 到 $j$ 的最短路距离 初始状态 $S$ 为空,$\mathrm{dp}[\varnothing ][i][j]$ 就等于 $i,j$ ......
Graph Floyd 295B Greg 295

B. Greg and Graph

题目 B. Greg and Graph 题意 输入 n(1≤n≤500) 表示 n 个点的有向完全图,然后输入 n*n 的邻接矩阵 a,其中 a[i][j] 表示 i 到 j 的边权,范围 [1,1e5](特例是 a[i][i]=0)。 图的节点编号从 1 开始。 然后输入 1~n 的排列,表示我 ......
Graph Greg and
共4篇  :1/1页 首页上一页1下一页尾页