Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstdio>
  3. #include<cstdlib>
  4. #include<ctime>
  5. #include<vector>
  6. #include<string>
  7. #include<algorithm>
  8. #include<utility>
  9. #include<map>
  10. #include<set>
  11. #include<queue>
  12. #include<sstream>
  13. #include<fstream>
  14. #include<cmath>
  15. #include<list>
  16. #include<deque>
  17. #include<stack>
  18. #include<bitset>
  19. #include<numeric>
  20. #include<iomanip>
  21. #include<memory.h>
  22. #include<cassert>
  23. using namespace std;
  24. typedef long long LL;
  25. const double EPS = 1e-8;
  26. struct diag
  27. {
  28. pair<int, int> a, b;
  29. pair<double, double> cent;
  30. LL len;
  31. diag(pair<int, int> aa, pair<int, int> bb)
  32. {
  33. a = aa;
  34. b = bb;
  35. cent = make_pair((a.first + b.first) / 2., (a.second + b.second) / 2.);
  36. len = (a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second);
  37. }
  38. };
  39. vector<diag> diags;
  40. vector<pair<int, int> > pnts;
  41. int main()
  42. {
  43. int n;
  44. cin >> n;
  45. for(int i = 0; i < n; i++)
  46. {
  47. int a, b;
  48. cin >> a >> b;
  49. }
  50. for(int i = 0; i < n; i++)
  51. for(int j = i + 1; j < n; j++)
  52. diags.push_back(diag(pnts[i], pnts[j]));
  53.  
  54. return 0;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement