Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#include "pch.h"
- #include <iostream>
- #include <vector>
- using namespace std;
- #define ll long long
- double sqr(double x) {
- return (x * x);
- }
- ostream & operator << (ostream & out, vector<ll> & v) {
- for (int i = 0; i < v.size(); i++) {
- out << v[i] << ' ';
- }
- return out;
- }
- int step(ll x, int n) {
- int y = x;
- x = 1;
- for (int i = 0; i < n; i++) {
- x *= y;
- }
- return x;
- }
- void LlVec(vector<ll> &a) {
- int x = 0;
- int h = 1;
- vector<char> fc;
- char c = getchar();
- if (c != '\n' & c != -1) {
- if (c == '-') {
- h = -1;
- c = getchar();
- }
- while (c != ' ' & c != '\n' & c != -1) {
- fc.push_back(c);
- c = getchar();
- }
- int k = fc.size();
- for (int i = k - 1; i >= 0; i--) {
- x += (fc[i] - 48) * step(10, k - i - 1);
- }
- x *= h;
- a.push_back(x);
- do {
- cin >> x;
- a.push_back(x);
- c = getchar();
- } while (c != -1 & c != '\n');
- }
- }
- int main()
- {
- vector<pair<int, int>> a;
- //LlVec(a);
- bool ans = true;
- for (int i = 0; i < 8; i++) {
- int x, y;
- cin >> x >> y;
- a.push_back(make_pair(x, y));
- }
- for (int i = 0; i < 8; i++) {
- pair<int, int> tmp = a[i];
- for (int j = 0; j < 8; j++) {
- //cout << (abs(tmp.first - a[j].first) == abs(tmp.second - a[j].second)) << ' ' << tmp.first << ' ' << tmp.second << ' ' << a[j].first << ' ' << a[j].second << endl;
- 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) {
- ans = false;
- break;
- }
- }
- if (!ans) break;
- }
- if (!ans) cout << "YES"; else cout << "NO";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement