Cod sursa(job #1918400)

Utilizator mworkgMaxim Stepanov mworkg Data 9 martie 2017 15:17:46
Problema Cele mai apropiate puncte din plan Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.67 kb
#include <fstream>
#include <math.h>
#include <stdio.h>

using namespace std;

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

double distanta(long n1, long m1, long n2, long m2) {
    return 1;
}

int main() {
    long long int puncte;
    double punct[100000][2];
    double dis,totaldis;
    cin >> puncte;
    for (int i = 0; i < puncte; i++) {
        cin >> punct[i][0] >> punct[i][1];
        for (int j = i; j != 0; j--) {
             if(i != j) {
             dis = distanta(punct[i][0], punct[i][1], punct[j][0], punct[j][1]);
             if ((dis < totaldis) || (totaldis == 0)) { totaldis = dis; }
             }
        }
    }

    cout << totaldis;
    return 0;
}