Pagini recente » Rezultatele filtrării | Diferente pentru propuneri/6-arhiva-educationala intre reviziile 4 si 16 | Statisticile problemei Yinyang | Rezultatele filtrării | Cod sursa (job #409845)
Cod sursa(job #409845)
#include<fstream>
#include<vector>
#include<math.h>
using namespace std;
int main()
{
int n;
ifstream fin("cmap.in");
ofstream fout("cmap.out");
fin>>n;
vector<int> xs(n);
vector<int> ys(n);
vector<double> dst(0);
for(int c = 0; c < n; c++)
{
int x,y;
fin>>x>>y;
xs[c] = x;
ys[c] = y;
for(int d = 0; d < c; d++)
{
double dsts = sqrt((xs[c] - xs[d])*(xs[c] - xs[d]) + (ys[c] - ys[d])*(ys[c] - ys[d]));
dst.push_back(dsts);
}
}
sort(dst.begin(), dst.end());
for(int c = 0; c < n; c++)
if(dst[c] != 0){
fout<<dst[c];break;}
return 0;
}