mrlolthe1st

Untitled

Oct 20th, 2021
609
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #define _CRT_SECURE_NO_WARNINGS
  3. #pragma GCC Optimize("Ofast")
  4. #include <iostream>
  5. #include <vector>
  6. #include <set>
  7. #include <chrono>
  8. #include <string>
  9. #include <time.h>
  10. #include <unordered_set>
  11. #include <cmath>
  12. #include <map>
  13. #include <queue>
  14. #include <unordered_map>
  15. #include <algorithm>
  16. #include <fstream>
  17. #include <sstream>
  18. #include <cstddef>
  19. #include <cstdio>
  20. #include <iostream>
  21. #include <memory>
  22. #include <stdexcept>
  23. #include <string>
  24. #include <array>
  25. using namespace std;
  26.  
  27. #define vi vector<int>
  28. #define vec vector
  29. #define int long long
  30. int gcd(int a, int b) {
  31.     return b ? gcd(b, a % b) : a;
  32. }
  33. const int MOD = 1e9 + 7;
  34.  
  35. int binpow(int a, int b) {
  36.     if (!b) return 1;
  37.     int x = binpow(a, b >> 1);
  38.     if (b & 1) {
  39.         return (((x * x) % MOD) * a) % MOD;
  40.     }
  41.     return (((x * x) % MOD) * 1) % MOD;
  42. }
  43. #define double long double
  44. vec<pair<double, double>> p = { { 0, 0} };
  45. vec<pair<double, double>> cur;
  46. int cc = 0;
  47. double dist(pair<double, double> a, pair<double, double> b) {
  48.     return (a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second);
  49. }
  50.  
  51. void calc(int c, int x) {
  52.     if (c == 0) {
  53.         double a = dist(cur[0], cur[1]);
  54.         double b = dist(cur[0], cur[2]);
  55.         double c = dist(cur[1], cur[2]);
  56.         if (abs(a - b) < 1e-5 && abs(a - c) < 1e-5 && abs(b - c) < 1e-5) {
  57.             ++cc;
  58.         }
  59.     }
  60.     else {
  61.         for (int j = x; j < p.size(); ++j) {
  62.             cur.push_back(p[j]);
  63.             calc(c - 1, j + 1);
  64.             cur.pop_back();
  65.         }
  66.     }
  67. }
  68. signed main() {
  69.     ios::sync_with_stdio(false);
  70.     cin.tie(0);
  71.     cout.tie(0);
  72.     int cnt = 66;
  73.     double pi = acos(-1);
  74.     for (int i = 0; i < cnt; ++i) {
  75.         p.push_back({ cos(2 * pi * i / cnt), sin(2 * pi * i / cnt) });
  76.     }
  77.     p = p;
  78.     calc(3, 0);
  79.     cout << cc;
  80. }
  81.  
RAW Paste Data