一个数 $n$ 必有一个不超过 $\sqrt n$ 的质因子。 打表处理出 $1$ 到 $\sqrt n$ 的质因子后去筛掉属于 $L$ 到 $R$ 区间的素数即可。 Code: ...
分类:
其他好文 时间:
2019-02-18 12:54:43
阅读次数:
176
题意:给出n个点 要求取k个点 这k个点中 距离最小的两个点要求距离最大 拿到手看不出是最大团 也看不出是二分答案(第一次用) 因为答案必然存在 一定有一个最值 所以用二分答案来做 最大距离为根号二乘10000 所以R=20000 且R-L>1e-4; ...
分类:
其他好文 时间:
2019-02-16 15:40:22
阅读次数:
173
A long-distance telephone company charges its customers by the following rules: Making a long-distance call costs a certain amount per minute, dependi ...
分类:
其他好文 时间:
2019-02-16 15:16:03
阅读次数:
176
链接:https://codeforces.com/gym/102028/problem/I 题意:数轴上有n个点,相邻两点间距离已知,取其中k点,求k点中每一对点距离和最大值,k分别取1,2,3,...,n 思路:k=i时,距离和为k=i-1时的距离和加上新选取的点与之前所取的点间距离和,所以每次 ...
分类:
其他好文 时间:
2019-02-14 00:10:50
阅读次数:
175
Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. You have the following 3 operations permitt ...
分类:
其他好文 时间:
2019-02-13 21:05:49
阅读次数:
171
算法描述: Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. You have the following 3 operations p ...
分类:
其他好文 时间:
2019-02-13 20:53:11
阅读次数:
165
"Prime Distance" Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 25099 Accepted: 6567 Description The branch of mathematics called number t ...
分类:
其他好文 时间:
2019-02-13 00:25:11
阅读次数:
153
题目描述 地址 : https://leetcode.com/problems/edit distance/description/ <! more 思路 使用 用来表示 的`0~i 1 word2 0~j 1`的最小编辑距离 我们可以知道边界情况: 、`dp[0][j] = j "" dp[0~i ...
分类:
编程语言 时间:
2019-02-08 18:32:04
阅读次数:
213
前言 这一节继续记录模块,本节将记录Python中一个非常重要的画图模块——turtle,Here we go! 一、turtle模块 turtle(海龟)模块是Python中强大的内置画图模块,可以模拟真实的画图环境以及画图步骤来画图。通常,我们画图需要两种工具,一个是画布,另一个是画笔;在tur ...
分类:
其他好文 时间:
2019-02-08 14:36:00
阅读次数:
152
<题目链接> 题目大意:一颗无向无环树,有n个顶点,求其中距离为k的点对数是多少,(u,v)与(v,u)为同一点对。 2019-02-07 ...
分类:
其他好文 时间:
2019-02-08 01:20:18
阅读次数:
188