#include <bits/stdc++.h>
#define C 1
#define P 0
#define debug(x) cerr << #x << " " << x << "\n"
#define debugs(x) cerr << #x << " " << x << " "
using namespace std;
typedef long long ll;
typedef pair <long double, long double> pii;
typedef pair <long long double, pii> muchie;
const ll NMAX = 100001;
const ll VMAX = 101;
const ll INF = (1LL << 60);
const ll MOD = 1000000007;
const ll BLOCK = 447;
const ll base = 117;
const ll nr_of_bits = 18;
const ll inv2 = 500000004;
map <pii, pii> mp;
pii v[NMAX * 2];
struct ura{
pii a, b;
};
vector <ura> sol;
map <pii, bool> scutit;
long double slope = 1;
bool mic(pii a, pii b){
return a < b;
}
bool cmp(pii a, pii b){
return (mic(a, b));
}
long double d(pii a, pii b){
return sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second));
}
map <pii, pii> cine;
int main() {
//ifstream cin(".in");
//ofstream cout(".out");
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, i;
cin >> n;
for(i = 1; i <= n; i++){
pii a, b;
cin >> a.first >> a.second >> b.first >> b.second;
if(mic(a, b))
swap(a, b);
v[i] = a;
pii c = {a.first, 0};
c.second = a.second + d(a, b);
cine[c] = b;
b = c;
mp[a] = b;
mp[b] = a;
}
sort(v + 1, v + n + 1, cmp);
for(i = 1; i < n; i++){
sol.push_back({v[i], mp[v[i + 1]]});
}
for(auto x : sol){
cout << cine[x.a].first << " " << cine[x.a].second << " " << cine[x.b].first << " " << cine[x.b].second << "\n";
}
return 0;
}
Compilation message
roads.cpp:10:20: error: 'long long' specified with 'double'
10 | typedef pair <long long double, pii> muchie;
| ^~~~