fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. int main() {
  5. double xA, yA, xB, yB, xC, yC, xD, yD;
  6. cin >> xA >> yA >> xB >> yB >> xC >> yC >> xD >> yD;
  7. double AB = sqrt((xA-xB)*(xA-xB)+(yA-yB)*(yA-yB)),
  8. BC = sqrt((xB-xC)*(xB-xC)+(yB-yC)*(yB-yC)),
  9. CD = sqrt((xC-xD)*(xC-xD)+(yC-yD)*(yC-yD)),
  10. DA = sqrt((xD-xA)*(xD-xA)+(yD-yA)*(yD-yA)),
  11. AC = sqrt((xA-xC)*(xA-xC)+(yA-yC)*(yA-yC)),
  12. BD = sqrt((xB-xD)*(xB-xD)+(yB-yD)*(yB-yD));
  13. unordered_map<double,ll> ans;
  14. ans[AB]++;
  15. ans[BC]++;
  16. ans[DA]++;
  17. ans[AC]++;
  18. ans[BD]++;
  19. ans[CD]++;
  20. for(pair<double,ll> it : ans) {
  21. if(it.second>=4) {cout << "Yes"; return 0;}
  22. }
  23. cout << "No";
  24. }
  25. //from Bip
Success #stdin #stdout 0.01s 5284KB
stdin
0 0 0 1 1 0 1 1
stdout
Yes