#!/usr/bin/pythonfrom math import sqrtdef euclidean(v1, v2): length = min(len(v1), len(v2)) if length == 0: return 0 d = 0 for i in range(length): d += pow((v1[i] - v2[i]), 2) #return sqrt(d) return 1 / float(1+d)def
Contestants DivisionTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 7396 Accepted: 2090DescriptionIn the new ACM-ICPC Regional Contest, a special monitoring and submitting system will be set up, and students will be able to compete at
DivisionTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 999999/400000 K (Java/Others)Total Submission(s): 2142 Accepted Submission(s): 851Problem DescriptionLittle D is really interested in the theorem of sets recently. There’s a problem
搞acm也一年了,我也不知道這一年到底收穫了很多,真的可以說,這一年,沒有白過吧,也許,可以說,是很充實,說實話,我這樣的人,搞ACM也就是為了拿一個獎,為了一個不可達到的獎,想要衝進word final ,然而,現實中,往往,一切都不是那麼容易,一切都是那麼難,但是反過來想,如果是,那麼容易,那又有什麼用呢?這一年,做的題目類型太多了,反正,我知道的演算法,我聽過的名字,我都想全都去學,但是,在真正用的時候卻不是那麼如意,因為,題目實在是變化多端,如果,全都只是一個瞭解,真正遇見題目又做不到,
Catch That CowTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 36079 Accepted: 11123DescriptionFarmer 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 ≤ 100,000) on a
題意:求出給定的凸多邊形的內接圓#include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>#include<algorithm>using namespace std;const int maxn = 155;const int maxm = 1005;const double Min = 0.0;const double Max = 10000000000
題意:給定一些點,求最大三角形面積/*凸包*/#include<stdio.h>#include<string.h>#include<stdlib.h>#include<algorithm>#include<iostream>#include<queue>//#include<map>#include<math.h>using namespace std;typedef long long ll;//
Conquer a New RegionTime Limit: 5 Seconds Memory Limit: 32768 KB The wheel of the history rolling forward, our king conquered a new region in a distant continent.There are N towns (numbered from 1 to N) in this region connected by several roads.