Cod sursa(job #3203457)

Utilizator AlexMoto2006Motoasca Alexandru-Lucian AlexMoto2006 Data 13 februarie 2024 18:19:21
Problema Cele mai apropiate puncte din plan Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.56 kb
#include <fstream>
#include <vector>
#include <set>
#include <cmath>
using namespace std;

int n,m;

struct coord {
	int x, y;
};
multiset<int> s;

ifstream cin("cmap.in");
ofstream cout("cmap.out");

int main()
{
	cin >> n;

	vector<coord> v(n+1);
	for (int i = 1; i <= n; i++)
	{
		cin >> v[i].x >> v[i].y;
	}
	for (int i = 1; i <= n; i++)
	{
		for (int j = i + 1; j <= n; j++)
		{
			s.insert((v[i].x - v[j].x) * 1ll * (v[i].x - v[j].x) + (v[i].y - v[j].y) * 1ll * (v[i].y - v[j].y));
		}	
	}
	cout << sqrt(*s.begin());
	return 0;
}