## 机器学习中常用的距离度量汇总

2023年8月18日 · 16 分钟 · 7795 字 · Kai Wang

## SGU 144 - Meeting

Description Two of the three members of the winning team of one of the ACM regional contests are going to meet in order to train for the upcoming World Finals. They decided that they will meet sometime between $X$ o’clock and $Y$ o’clock. Because they never get anywhere on time (they were late even on the day of the regional contest), they did not set an exact time when they will meet. However, they decided that the one who gets first at the meeting point will not wait more than $Z$ minutes for the other one (they calculated that, if the other one will not come within $Z$ minutes from the arrival of the first of them, then it is very probable that he will not show up at all). Knowing that, in the end, both of them will show up at some time between $X$ o’clock and $Y$ o’clock (not necessarily after an integer number of minutes), compute which is the probability that they will actually meet. Input The input will contain 2 integer numbers $X$ and $Y$ ($0\leq X < Y\leq 24$) and one real number $Z$ ($0 < Z\leq 60(Y-X)$). Output You should output the required probability with 7 decimal digits (rounded according to the 8th decimal digit). Sample Input 11 12 20.0 Sample Output 0.5555556 Analysis 这是一道纯粹的数学概率题，我们可以进行公式推导。首先我们需要...

2015年7月22日 · 1 分钟 · 464 字 · Kai Wang

## SGU 116 - Index of super-prime

Description Let $P_1, P_2,\cdots ,P_N,\cdots$ be a sequence of prime numbers. Super-prime number is such a prime number that its current number in prime numbers sequence is a prime number too. For example, 3 is a super-prime number, but 7 is not. Index of super-prime for number is 0 iff it is impossible to present it as a sum of few (maybe one) super-prime numbers, and if such presentation exists, index is equal to minimal number of items in such presentation. Your task is to find index of super-prime for given numbers and find optimal presentation as a sum of super-primes. Input There is a positive integer number in input. Number is not more than 10000. Output Write index $I$ for given number as the first number in line. Write I super-primes numbers that are items in optimal presentation for given number. Write these I numbers in order of non-increasing. Sample Input 6 Sample Output 2 3 3 Analysis 首先，我们可以根据筛法求出 10000 以内的素数，接下来我们继续利用筛法，求出这些素数中，下标为素数的超级素数，这样我们就得到了题目中所需要的超级素数。 对于寻找一个最优的组合，我们可以使用 0/1 背...

2015年7月20日 · 2 分钟 · 519 字 · Kai Wang

## 专题一、简单搜索 - Virtual Judge

2015年6月8日 · 9 分钟 · 4250 字 · Kai Wang

## 2048 游戏制作过程（Java 描述）：第五节、界面美化

2015年5月17日 · 3 分钟 · 1347 字 · Kai Wang

## 2048 游戏制作过程（Java 描述）：第四节、游戏逻辑

2015年5月15日 · 7 分钟 · 3052 字 · Kai Wang

## 2048 游戏制作过程（Java 描述）：第三节、创建界面

2015年5月14日 · 4 分钟 · 1539 字 · Kai Wang

## 2048 游戏制作过程（Java 描述）：第二节、基本设置

2015年5月14日 · 3 分钟 · 1115 字 · Kai Wang

## 2048 游戏制作过程（Java 描述）：第一节、创建项目

2015年5月8日 · 4 分钟 · 1566 字 · Kai Wang

## 扫雷游戏制作过程（CSharp 描述）：第八节、整体完善

2015年5月2日 · 5 分钟 · 2300 字 · Kai Wang