Pagini recente » Cod sursa (job #3239011) | Cod sursa (job #2529488) | Cod sursa (job #1757293) | Cod sursa (job #3137761) | Cod sursa (job #2487099)
#include <iostream>
#include <fstream>
#include <bits/stdc++.h>
#include <map>
#define pb push_back
using namespace std;
vector <pair<int,int> > v;
double dist(pair <int,int> a,pair<int,int> b)
{
int p1x=a.first;
int p1y=a.second;
int p2x=b.first;
int p2y=b.second;
return sqrt((double)((long long)((long long)p1x-p2x)*(p1x-p2x)+(long long)((long long)p1y-p2y)*(p1y-p2y)));
}
bool compare(pair <int,int> a,pair <int,int> b)
{
if(a.first!=b.first)
{
return (a.first<b.first);
}
else
{
return (a.second<b.second);
}
}
double divide(int st,int dr)
{
int mij,minL,minR;
while(st<=dr)
{
mij=(st+dr)/2;
minL=cautare(st,mij);
minR=cautare(mij,dr);
}
}
int main()
{
ifstream fin("cmap.in");
ofstream fout("cmap.out");
int n,i,j,a,b;
double f;
double min=999999999;
fin>>n;
for(i=1;i<=n;i++)
{
fin>>a>>b;
v.pb({a,b});
}
int dist_best=1e9;
sort(v.begin(),v.end());
divide(1,n);
fout<<sqrt(dist_best);
fin.close();
fout.close();
return 0;
}