Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. //#include "pch.h"
  2. #include <iostream>
  3. #include <vector>
  4. using namespace std;
  5.  
  6. #define ll long long
  7.  
  8. double sqr(double x) {
  9. return (x * x);
  10. }
  11.  
  12. ostream & operator << (ostream & out, vector<ll> & v) {
  13. for (int i = 0; i < v.size(); i++) {
  14. out << v[i] << ' ';
  15. }
  16. return out;
  17. }
  18.  
  19.  
  20. int step(ll x, int n) {
  21. int y = x;
  22. x = 1;
  23. for (int i = 0; i < n; i++) {
  24. x *= y;
  25. }
  26. return x;
  27. }
  28.  
  29. void LlVec(vector<ll> &a) {
  30. int x = 0;
  31. int h = 1;
  32. vector<char> fc;
  33. char c = getchar();
  34. if (c != '\n' & c != -1) {
  35. if (c == '-') {
  36. h = -1;
  37. c = getchar();
  38. }
  39. while (c != ' ' & c != '\n' & c != -1) {
  40. fc.push_back(c);
  41. c = getchar();
  42. }
  43. int k = fc.size();
  44. for (int i = k - 1; i >= 0; i--) {
  45. x += (fc[i] - 48) * step(10, k - i - 1);
  46. }
  47. x *= h;
  48. a.push_back(x);
  49. do {
  50. cin >> x;
  51. a.push_back(x);
  52. c = getchar();
  53. } while (c != -1 & c != '\n');
  54. }
  55. }
  56.  
  57. int main()
  58. {
  59. vector<pair<int, int>> a;
  60. //LlVec(a);
  61. bool ans = true;
  62.  
  63. for (int i = 0; i < 8; i++) {
  64. int x, y;
  65. cin >> x >> y;
  66. a.push_back(make_pair(x, y));
  67. }
  68. for (int i = 0; i < 8; i++) {
  69. pair<int, int> tmp = a[i];
  70. for (int j = 0; j < 8; j++) {
  71. //cout << (abs(tmp.first - a[j].first) == abs(tmp.second - a[j].second)) << ' ' << tmp.first << ' ' << tmp.second << ' ' << a[j].first << ' ' << a[j].second << endl;
  72. if ((tmp.first == a[j].first | tmp.second == a[j].second | abs(tmp.first - a[j].first) == abs(tmp.second - a[j].second)) & j != i) {
  73. ans = false;
  74. break;
  75. }
  76. }
  77. if (!ans) break;
  78. }
  79. if (!ans) cout << "YES"; else cout << "NO";
  80.  
  81.  
  82.  
  83. return 0;
  84.  
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement