摘要: 【代码】 dfs模板 cpp include include include include include include include using namespace std; define f(i,n) for(int i=1;i 阅读全文
posted @ 2017-11-09 08:41 qwerfcxs 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 【代码】 Kruskal模板 cpp include include include include include include include using namespace std; define f(i,n) for(int i=1;i 阅读全文
posted @ 2017-11-09 08:39 qwerfcxs 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 【代码】 dijstra模板 阅读全文
posted @ 2017-11-09 08:36 qwerfcxs 阅读(149) 评论(0) 推荐(0) 编辑
摘要: spfa模板 【代码】 阅读全文
posted @ 2017-11-09 08:32 qwerfcxs 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 【问题描述】 涵涵有两盒火柴,每盒装有 n 根火柴,每根火柴都有一个高度。现在将每盒中的火柴各自排成一列,同一列火柴的高度互不相同,两列火柴之间的距离定义为:数列 (ai bi)\ (ai bi) (i=1,2,3,……,n) 的前 n 项和。其中 ai 表示第一列火柴中第 i 个火柴的高度, bi 阅读全文
posted @ 2017-11-08 15:26 qwerfcxs 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 【题目描述】 今年, n 只思考熊参加了清华大学校园马拉松比赛。马拉松的赛道是环形的,每圈 的长度是 A ,完成比赛需要跑 L 圈。 比赛中,甲领先乙很长距离,绕过一圈或多圈后从后面追上了乙的现象叫做“套 圈”。套圈现象非常常见,例如:跑得比谁都快的 saffah 熊可以套某些熊 L 1 圈; uf 阅读全文
posted @ 2017-11-08 10:09 qwerfcxs 阅读(1144) 评论(4) 推荐(0) 编辑
摘要: 【问题描述】 今天 F 大爷看到了一张 n 个点的无向完全图,每条边有边权。 F 大爷一开心就花 0.03 飞秒(即 3\ 10 17 秒)求了一下这张图的最小生 成树以及最小生成树的个数。 F 大爷惊喜地发现这张图只有一个最小 生成树,他现在更开心了,于是他把这个最小生成树告诉了你,要你 求出原来 阅读全文
posted @ 2017-11-08 09:44 qwerfcxs 阅读(153) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2017-11-08 09:41 qwerfcxs 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 【问题描述】 拼图达人小 C 手里有 n 个 1\ 1 的正方形方块,他希望把这些方 块拼在一起,使得拼出的图形周长最小,要求方块不能重叠。擅长拼 图的小 C 一下就求出了这个周长,顺便他想考考你会不会求。 【输入格式】 多组数据,第一行一个正整数 T ,表示数据组数。 接下来 T 行,每行一个正整 阅读全文
posted @ 2017-11-08 09:07 qwerfcxs 阅读(93) 评论(0) 推荐(0) 编辑