https://www.luogu.org/problem/P2886 题目描述: 给出一张无向连通图,求$S$到$E$经过$k$条边的最短路。 对于一类$S$到$E$走指定数量的边数,求它的最短路或条数,都可以采用矩阵快速幂的方式解决.我们回忆一下那一个慢得惊人的$floyd$算法,将它的$dp$ ...
分类:
其他好文 时间:
2020-01-25 15:26:27
阅读次数:
78
You have some sticks with positive integer lengths. You can connect any two sticks of lengths X and Y into one stick by paying a cost of X + Y. You pe ...
分类:
其他好文 时间:
2020-01-24 09:32:12
阅读次数:
90
索引类型:Unique(唯一索引,一般为主键),Normal(一般索引,普通字段,可做组合索引),索引方法:BTREE 1.选择唯一性索引 唯一性索引的值是唯一的,可以更快速的通过该索引来确定某条记录。例如,学生表中学号是具有唯一性的字段。为该字段建立唯一性索引可以很快的确定某个学生的信息。如果使用 ...
分类:
数据库 时间:
2020-01-24 00:33:37
阅读次数:
126
根据题意,需要交换的部分会形成若干个不相交的环,独立处理每个环。 每个环可以用环内的最小值去和其它元素交换,或者用全局最小值和环上最小值交换,做一遍再交换回去。 #include <cstdio> #include <cstring> const int MOD = 9973; int m, n, ...
分类:
其他好文 时间:
2020-01-23 19:49:04
阅读次数:
60
链接:http://poj.org/problem?id=3278 题目: Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at ...
分类:
其他好文 时间:
2020-01-23 12:37:55
阅读次数:
96
题目 :http://poj.org/problem?id=3617 给定一个字符序列S,按一定规则输出最小字典序的结果,规则是:如果S的头部字符小于尾部字符,那么将S的头部字符加到输出字符串,然后删除这个字符,得到新的头部字符,反之同样。 输入样例 : 6 A C D B C B 输出样例 : A ...
分类:
其他好文 时间:
2020-01-22 22:22:56
阅读次数:
85
# **Catch That Cow(抓住那只奶牛)**【题意】:农场主要去追一直逃跑的牛,每次移动有三种选择,位置加一,位置减一,位置乘二,要找到最快的方法让农夫追到牛(也就是移动的次数最少,这个过程是线性的)具体的题目请见:[原题链接:](http://poj.org/problem?id=32 ...
分类:
其他好文 时间:
2020-01-22 20:13:41
阅读次数:
110
Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic ID ...
分类:
其他好文 时间:
2020-01-22 20:05:48
阅读次数:
73
Problem Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ...
分类:
其他好文 时间:
2020-01-22 14:39:56
阅读次数:
72
A - Cow Contest N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better th ...
分类:
其他好文 时间:
2020-01-21 00:23:35
阅读次数:
73