Cod sursa(job #2876744)
Utilizator | Data | 23 martie 2022 15:20:42 | |
---|---|---|---|
Problema | Trapez | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream u("trapez.in");
ofstream o("trapez.out");
long long n,x[1000],y[1000],i,j,s;unordered_map<double,long long>a;
int main()
{
u>>n;
for(i=0;i<n;i++){u>>x[i]>>y[i];for(j=0;j<i;j++)s+=a[(double)(x[i]-x[j])/(y[i]-y[j])]++;}
o<<s;
}