0_0_38045332_32371.cpp:1:1876: fatal error: GCC4.9.2/lib/gcc/x86_64-w64-mingw32/4.9.2/include/iostream>usin: Invalid argument
#include <iostream>using namespace std;typedef long long Lint;const int maxn = 5e5 + 10;Lint x[maxn], y[maxn];int n;bool check(Lint x1, Lint y1, Lint x2, Lint y2) { if (x1 == x2) return true; if (y1 == y2) return true; if (abs(x1 - x2) == abs(y1 - y2)) return true; return false;}bool is_ok(Lint xx, Lint yy) { for (int i = 1; i <= n; i++) { if (!check(xx, yy, x[i], y[i])) { return false; } } return true;}void solve() { cin >> n; for (int i = 1; i <= n; i++) { cin >> x[i] >> y[i]; x[i] <<= 1; y[i] <<= 1; } int pos = 0; for (int i = 2; i <= n; i++) { if (!check(x[1], y[1], x[i], y[i])) { pos = i; break; } } if (pos == 0) { cout << "YES\n"; return; } pair<Lint, Lint> V[] = {{x[pos], y[1]}, {x[1], y[pos]}, {(y[pos] - y[1] + x[1] + x[pos]) / 2, (x[pos] - x[1] + y[1] + y[pos]) / 2}, {(y[1] - y[pos] + x[1] + x[pos]) / 2, (x[1] - x[pos] + y[1] + y[pos]) / 2}, {x[1] - y[1] + y[pos], y[pos]}, {x[pos] - y[pos] + y[1], y[1]}, {x[pos] - y[1] + y[pos], y[1]}, {x[1] - y[pos] + y[1], y[pos]}, {x[pos], x[1] - x[pos] + y[1]}, {x[1], x[pos] - x[1] + y[pos]}, {x[1], x[1] - x[pos] + y[pos]}, {x[pos], x[pos] - x[1] + y[1]}}; for (auto it : V) { Lint x = it.first, y = it.second; if (is_ok(x, y)) { cout << "YES\n"; return; } } cout << "NO\n";}int main() { ios::sync_with_stdio(0); cin.tie(0); int T; cin >> T; while (T--) solve(); return 0;}
^
compilation terminated.
|