Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <set>
- #include <cmath>
- #include <iomanip>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- set <double> z;
- int a[50][2];
- for (int i = 0; i<n; i++) {
- for (int j = 0; j<2; j++) {
- cin >> a[i][j];
- }
- }
- for (int i = 0; i<n; i++) {
- for (int j = 0; j<n; j++) {
- if (i!=j) {
- z.insert(sqrt(pow(a[i][0]-a[j][0],2)+pow(a[i][1]-a[j][1],2)));
- }
- }
- }
- cout << z.size() << endl;
- for (auto s : z) {
- cout << setprecision(1000) << s << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement