text stringlengths 49 983k |
|---|
#include <bits/stdc++.h>
using namespace std;
int main() {
std::ios_base::sync_with_stdio(false);
long long int a, b, c, d, e, f;
cin >> a >> b >> c >> d >> e >> f;
if (a * (d - f) + c * (f - b) + e * (b - d) == 0) {
cout << "No";
return 0;
}
long long int temp = (c - a) * (c - a) + (d - b) * (d - b);
long long int temp2 = (e - c) * (e - c) + (f - d) * (f - d);
if (temp == temp2) {
cout << "Yes";
} else {
cout << "No";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long ax, ay, bx, by, cx, cy, flag = 0;
long long f(long long x1, long long y1, long long x2, long long y2) {
long long res = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
return res;
}
bool isColinear() {
long long res1 = (by - ay) * (cx - bx);
long long res2 = (cy - by) * (bx - ax);
if (res1 == res2)
return true;
else
return false;
}
int main() {
cin >> ax >> ay >> bx >> by >> cx >> cy;
if (isColinear() == true)
flag = 0;
else {
long long dis1 = f(ax, ay, bx, by);
long long dis2 = f(bx, by, cx, cy);
if (dis1 == dis2)
flag = 1;
else
flag = 0;
}
if (flag == 1)
printf("Yes\n");
else
printf("No\n");
}
|
#include <bits/stdc++.h>
using namespace std;
const double EPS = 1.0e-8;
const int maxn = 3e3 + 100;
const int maxm = 300;
long long ax, ay, bx, by, cx, cy;
bool check() {
if (1LL * (cy - by) * (cx - ax) == 1LL * (cy - ay) * (cx - bx)) return false;
long long len2 = 1LL * (cy - by) * (cy - by) + 1LL * (cx - bx) * (cx - bx);
long long len3 = 1LL * (ay - by) * (ay - by) + 1LL * (ax - bx) * (ax - bx);
if (len2 == len3) return true;
return false;
}
int main() {
while (cin >> ax >> ay >> bx >> by >> cx >> cy) {
if (check()) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
}
|
#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void chmin(T &x, U y) {
if (y < x) x = y;
}
const long long oo = 1e9 + 7;
int ax, ay, bx, by, cx, cy;
int main() {
cin >> ax >> ay >> bx >> by >> cx >> cy;
int check1 = 0, check2 = 1;
long long d1 = 1LL * (ax - bx) * (ax - bx) + 1LL * (ay - by) * (ay - by);
long long d2 = 1LL * (bx - cx) * (bx - cx) + 1LL * (by - cy) * (by - cy);
if (d1 == d2) check1 = 1;
if (bx == double(ax + cx) / 2 && by == double(ay + cy) / 2) check2 = 0;
if (ax == double(bx + cx) / 2 && ay == double(by + cy) / 2) check2 = 0;
if (cx == double(ax + bx) / 2 && cy == double(ay + by) / 2) check2 = 0;
if (check1 && check2)
cout << "yes";
else
cout << "no";
}
|
#include <bits/stdc++.h>
int main() {
double ax, ay, bx, by, cx, cy;
scanf("%lf%lf%lf%lf%lf%lf", &ax, &ay, &bx, &by, &cx, &cy);
long long A, B;
A = (ax - bx) * (ax - bx) + (ay - by) * (ay - by);
B = (bx - cx) * (bx - cx) + (by - cy) * (by - cy);
if ((ax - bx) / (ay - by) == (ax - cx) / (ay - cy)) A = 0;
if (A == B)
printf("Yes");
else
printf("No");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const double g = 10.0, eps = 1e-7;
const int N = 100000 + 10, maxn = 60000 + 10, inf = 0x3f3f3f;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
double ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
if ((ax - bx) * (ax - bx) + (ay - by) * (ay - by) !=
(bx - cx) * (bx - cx) + (by - cy) * (by - cy)) {
cout << "No" << endl;
return 0;
}
if (ax + cx == 2 * bx && ay + cy == 2 * by) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long double a[3][2];
long double dis(int x, int y) {
long double ans = 0;
for (int i = 0; i < 2; i++) {
if (a[x][i] > a[y][i])
ans += ((a[x][i] - a[y][i]) * (a[x][i] - a[y][i]));
else
ans += ((a[y][i] - a[x][i]) * (a[y][i] - a[x][i]));
}
return ans;
}
bool iscollinear() {
return (((a[2][0] - a[1][0]) * (a[1][1] - a[0][1])) ==
((a[2][1] - a[1][1]) * (a[1][0] - a[0][0])));
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) cin >> a[i][j];
}
if (dis(0, 1) == dis(1, 2) && !iscollinear())
cout << "yes" << endl;
else
cout << "no" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
struct point {
long long x, y;
};
double line(point a, point b) {
return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
}
int main() {
point a, b, c;
while (scanf("%lld%lld%lld%lld%lld%lld", &a.x, &a.y, &b.x, &b.y, &c.x,
&c.y) != EOF) {
if (line(a, b) == line(b, c) &&
(a.x - b.x) * (c.y - b.y) != (c.x - b.x) * (a.y - b.y))
printf("Yes\n");
else
printf("No\n");
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int dr[] = {-1, 0, 1, 0, -1, -1, 1, 1};
const int dc[] = {0, -1, 0, 1, -1, 1, -1, 1};
long long ax, ay, bx, by, cx, cy;
long long dist(long long x1, long long y1, long long x2, long long y2) {
return ((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2));
}
int main() {
cin >> ax >> ay >> bx >> by >> cx >> cy;
if (dist(ax, ay, bx, by) != dist(bx, by, cx, cy)) {
cout << "No\n";
return 0;
}
if (ax - bx == bx - cx && ay - by == by - cy)
cout << "No\n";
else if (ax - cx == cx - bx && ay - cy == cy - by)
cout << "No\n";
else if (bx - ax == ax - cx && by - ay == ay - cy)
cout << "No\n";
else if (bx - cx == cx - ax && by - cy == cy - ay)
cout << "No\n";
else if (cx - ax == ax - cx && cy - ay == ay - cy)
cout << "No\n";
else if (cx - bx == bx - cx && cy - by == by - cy)
cout << "No\n";
else
cout << "Yes\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
const double eps = 1e-8;
int main() {
long long ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
long long d1 = 1ll * (ax - bx) * (ax - bx) + 1ll * (ay - by) * (ay - by);
long long d2 = 1ll * (bx - cx) * (bx - cx) + 1ll * (by - cy) * (by - cy);
int flag = 1;
if (ax == bx && bx == cx)
flag = 0;
else if (ay == by && by == cy)
flag = 0;
else if ((by - ay) * (cx - ax) == (bx - ax) * (cy - ay))
flag = 0;
if (d1 == d2 && flag)
puts("Yes");
else
puts("No");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long double ax, ay, bx, by, cx, cy;
long double dis(long double x1, long double y1, long double x2,
long double y2) {
return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
int main() {
cin >> ax >> ay >> bx >> by >> cx >> cy;
long double d1 = dis(ax, ay, bx, by);
long double d2 = dis(bx, by, cx, cy);
if (((by - ay) * (cx - bx)) == ((bx - ax) * (cy - by)) || (d1 != d2))
cout << "No";
else
cout << "Yes";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 50;
const int inf = 0x3f3f3f3f;
const double esp = 1e-8;
int main() {
long long ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
unsigned long long dis1 = ((bx - ax) * (bx - ax) + (by - ay) * (by - ay));
unsigned long long dis2 = ((cx - bx) * (cx - bx) + (cy - by) * (cy - by));
if (dis1 == dis2 && ((by - ay) * (cx - bx) != (bx - ax) * (cy - by)))
puts("Yes");
else
puts("No");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long ax, ay, bx, by, cx, cy;
long long slope1, slope2;
long long side1, side2, side3;
cin >> ax >> ay >> bx >> by >> cx >> cy;
if ((cy - by) * (ax - bx) != (ay - by) * (cx - bx) &&
(ax - bx) * (ax - bx) + (ay - by) * (ay - by) ==
(cx - bx) * (cx - bx) + (cy - by) * (cy - by))
cout << "Yes";
else
cout << "No";
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long xa, ya, xb, yb, xc, yc;
while (cin >> xa >> ya >> xb >> yb >> xc >> yc) {
if ((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya) ==
(xc - xb) * (xc - xb) + (yc - yb) * (yc - yb) &&
(xc - xb) * (yb - ya) != (yc - yb) * (xb - xa)) {
printf("Yes\n");
} else {
printf("No\n");
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int ax, ay, bx, by, cx, cy, dx, dy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
if ((ax - bx) * (ax - bx) + (ay - by) * (ay - by) ==
(cx - bx) * (cx - bx) + (cy - by) * (cy - by) &&
(ay - by) * (bx - cx) != (by - cy) * (ax - bx)) {
printf("Yes");
} else
printf("No");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long cross(complex<long long> a, complex<long long> b) {
return (conj(a) * b).imag();
}
long long dis(complex<long long> a, complex<long long> b) {
return ((a.real() - b.real()) * (a.real() - b.real())) +
((a.imag() - b.imag()) * (a.imag() - b.imag()));
}
int main() {
long long x1, y1;
cin >> x1 >> y1;
long long x2, y2;
cin >> x2 >> y2;
long long x3, y3;
cin >> x3 >> y3;
complex<long long> a(x1, y1), b(x2, y2), c(x3, y3);
if (dis(a, b) == dis(b, c) && cross(a - b, c - b) != 0) {
cout << "YES\n";
} else {
cout << "NO\n";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int cases = 1;
while (cases--) {
long long int a, b, x, y, m, n;
cin >> a >> b >> x >> y >> m >> n;
long long int d1 = (a - x) * (a - x) + (b - y) * (b - y);
long long int d2 = (x - m) * (x - m) + (y - n) * (y - n);
long long int t1 = (n - b) * (x - a);
long long int t2 = (m - a) * (y - b);
if (d1 != d2 || t1 == t2) {
cout << "NO\n";
} else
cout << "YES\n";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long n, m, i, x, y, j, k, l, x1, x2, y1, y2;
string a, b = "";
cin >> x >> y >> x1 >> y1 >> x2 >> y2;
n = (x - x1) * (x - x1) + (y - y1) * (y - y1);
m = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
if (n == m) {
i = (x + x2);
j = (y + y2);
if (x1 * 2 == i && y1 * 2 == j)
cout << "No" << endl;
else
cout << "Yes" << endl;
} else
cout << "No" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int MAXN = 1e6 + 9;
const int INF = 0x3f3f3f3f;
const double EPS = 1e-6;
inline int sgn(double x) {
if (x < -EPS) return -1;
return x > EPS;
}
inline int cmp(double x, double y) { return sgn(x - y); }
int n, m;
struct Point {
double x, y;
void read() { scanf("%lf%lf", &x, &y); }
Point operator-(const Point p) const { return (Point){x - p.x, y - p.y}; }
double len2() { return x * x + y * y; }
double operator^(const Point p) const { return x * p.x + y * p.y; }
} p[5];
Point getp(double a1, double b1, double c1, double a2, double b2, double c2) {
return (Point){(c1 * b2 - c2 * b1) / (a1 * b2 - a2 * b1),
(c1 * a2 - c2 * a1) / (a2 * b1 - a1 * b2)};
}
void solve() {
if (cmp((p[1].x - p[2].x) * (p[3].y - p[2].y),
(p[3].x - p[2].x) * (p[1].y - p[2].y)) == 0) {
printf("No\n");
return;
}
Point d = getp(p[2].x - p[1].x, p[2].y - p[1].y,
-((p[1].x * p[1].x - p[2].x * p[2].x) / 2 +
(p[1].y * p[1].y - p[2].y * p[2].y) / 2),
p[3].x - p[2].x, p[3].y - p[2].y,
-((p[2].x * p[2].x - p[3].x * p[3].x) / 2 +
(p[2].y * p[2].y - p[3].y * p[3].y) / 2));
if (cmp(((p[1] - d) ^ (p[2] - d)), ((p[2] - d) ^ (p[3] - d))) == 0) {
printf("Yes\n");
} else {
printf("No\n");
}
}
void init() {
for (int i = (int)(1); i <= (int)(3); i++) {
p[i].read();
}
}
int main() {
int T = 1;
while (T--) {
init();
solve();
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long ax, ay, bx, by, cx, cy;
long long dxa, dya, dxb, dyb, dxc, dyc;
cin >> ax >> ay >> bx >> by >> cx >> cy;
dxa = bx - cx;
dxb = ax - cx;
dxc = ax - bx;
dya = by - cy;
dyb = ay - cy;
dyc = ay - by;
dxa *= dxa;
dxb *= dxb;
dxc *= dxc;
dya *= dya;
dyb *= dyb;
dyc *= dyc;
if (ax * by + bx * cy + cx * ay == cx * by + bx * ay + ax * cy)
cout << "No\n";
else if (dxa + dya == dxc + dyc)
cout << "Yes\n";
else
cout << "No\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int collinear(long long x1, long long y1, long long x2, long long y2,
long long x3, long long y3) {
long long a = x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2);
return a == 0 ? 1 : 0;
}
int main() {
long long ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
long long ab = ax - bx;
ab *= ab;
ab += (ay - by) * (ay - by);
long long cb = cx - bx;
cb *= cb;
cb += (cy - by) * (cy - by);
if (ab == cb && !collinear(ax, ay, bx, by, cx, cy))
cout << "Yes";
else
cout << "No";
}
|
#include <bits/stdc++.h>
using namespace std;
string mirror = "AHIMOTUVWXY";
string letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main() {
long long n, m, i, j, k, x, y, z, t;
long long ax, bx, cx, ay, by, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
long long ab = (ax - bx) * (ax - bx) + (ay - by) * (ay - by);
long long bc = (bx - cx) * (bx - cx) + (by - cy) * (by - cy);
if (ab == bc) {
if ((by - ay) * (cx - ax) == ((bx - ax) * (cy - ay)))
printf("NO\n");
else
printf("YES\n");
} else {
printf("NO\n");
}
}
|
#include <bits/stdc++.h>
using namespace std;
int const N = 1e6 + 1, oo = 2e9 + 1;
int n, m, q, k, x, y, a[N];
int ax, ay, bx, by, cx, cy;
long long dist(int x1, int y1, int x2, int y2) {
return (1ll * (x1 - x2) * (x1 - x2)) + (1ll * (y1 - y2) * (y1 - y2));
}
int main() {
scanf("%d %d %d %d %d %d", &ax, &ay, &bx, &by, &cx, &cy);
long long ab = dist(ax, ay, bx, by);
long long ac = dist(ax, ay, cx, cy);
long long bc = dist(bx, by, cx, cy);
if ((1ll * (1ll * ax * (by - cy)) + (1ll * bx * (cy - ay)) +
(1ll * cx * (ay - by)) !=
0) &&
(ab == ac || ab == bc)) {
puts("YES");
} else {
puts("NO");
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main(void) {
long long ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
long long ab = (ax - bx) * (ax - bx) + (ay - by) * (ay - by);
long long bc = (cx - bx) * (cx - bx) + (cy - by) * (cy - by);
if ((ax - bx) * (ax - bx) - (cx - bx) * (cx - bx) + (ay - by) * (ay - by) -
(cy - by) * (cy - by) ==
0 &&
1LL * (by - ay) * (cx - ax) != 1LL * (bx - ax) * (cy - ay))
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long ax, ay, bx, by, cx, cy;
int main() {
cin >> ax >> ay >> bx >> by >> cx >> cy;
long long ff1 = (ax - bx) * (ax - bx) + (ay - by) * (ay - by);
long long ff2 = (bx - cx) * (bx - cx) + (by - cy) * (by - cy);
if ((bx - ax) * (cy - ay) == (cx - ax) * (by - ay))
printf("NO\n");
else if (ff1 == ff2)
printf("YES\n");
else
printf("NO\n");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
double dis(double x1, double y1, double x2, double y2) {
return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
}
double vec(double x1, double y1, double x2, double y2, double x3, double y3) {
double a1 = x2 - x1;
double a2 = x3 - x1;
double b1 = y2 - y1;
double b2 = y3 - y1;
return a1 * b2 - a2 * b1;
}
int main() {
double x1, y1, x2, y2, x3, y3;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
if (vec(x1, y1, x2, y2, x3, y3) == 0) {
cout << "No";
return 0;
} else {
if ((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1) !=
(x3 - x2) * (x3 - x2) + (y3 - y2) * (y3 - y2))
cout << "NO";
else
cout << "Yes";
}
return 0;
}
|
#include <bits/stdc++.h>
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-8;
using namespace std;
const int maxn = 1000 + 10;
struct acmer {
int x, y;
};
int main() {
acmer a, b, c;
scanf("%d%d%d%d%d%d", &a.x, &a.y, &b.x, &b.y, &c.x, &c.y);
bool flag = 1;
if ((long long)(c.x - b.x) * (b.y - a.y) ==
(long long)(c.y - b.y) * (b.x - a.x))
flag = 0;
if (flag == 0)
puts("No");
else {
long long x = (long long)(a.x - b.x) * (a.x - b.x) +
(long long)(a.y - b.y) * (a.y - b.y);
long long y = (long long)(b.x - c.x) * (b.x - c.x) +
(long long)(b.y - c.y) * (b.y - c.y);
if (x == y)
puts("Yes");
else
puts("No");
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long int M = 100000000000000;
long long int M1 = 1000000007;
int main() {
long long int a1, a2, b1, b2, c1, c2, x1, x2, x3, x4, x5, x6;
double f1, f2;
cin >> a1 >> a2 >> b1 >> b2 >> c1 >> c2;
if (a1 == b1 && b1 == c1) {
cout << "No" << endl;
return 0;
}
x1 = pow(abs(b1 - a1), 2) + pow(abs(b2 - a2), 2);
x2 = pow(abs(b1 - c1), 2) + pow(abs(b2 - c2), 2);
x3 = b2 - a2;
x4 = b1 - a1;
x5 = b2 - c2;
x6 = b1 - c1;
if (x4 == 0 || x6 == 0) {
f1 = 1;
f2 = 2;
} else {
f1 = (float)x3 / x4;
f2 = (float)x5 / x6;
}
if (f1 != f2 && x1 == x2)
cout << "Yes";
else
cout << "No";
cout << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int ax, ay, bx, by, cx, cy;
scanf("%lld%lld%lld%lld%lld%lld", &ax, &ay, &bx, &by, &cx, &cy);
if ((ax - bx) * (cy - by) - (ay - by) * (cx - bx) != 0 &&
(ay - by) * (ay - by) + (ax - bx) * (ax - bx) ==
(cy - by) * (cy - by) + (cx - bx) * (cx - bx))
printf("Yes\n");
else
printf("No\n");
}
|
#include <bits/stdc++.h>
int a[2], b[2], c[2];
long long line(long long x1, long long y1, long long x2, long long y2) {
return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}
bool tr() {
if (a[0] - b[0] == 0 && a[0] - c[0] == 0) return false;
if (a[0] - b[0] == 0 || a[0] - c[0] == 0) return true;
if (((double)a[1] - b[1]) / (a[0] - b[0]) ==
((double)a[1] - c[1]) / (a[0] - c[0]))
return false;
return true;
}
int main() {
std::cin >> a[0] >> a[1] >> b[0] >> b[1] >> c[0] >> c[1];
std::cout << (tr() && line(a[0], a[1], b[0], b[1]) ==
line(b[0], b[1], c[0], c[1])
? "Yes"
: "No");
}
|
#include <bits/stdc++.h>
using namespace std;
pair<int, int> a, b, c;
long long dist(pair<int, int> a, pair<int, int> b) {
return 1LL * (a.first - b.first) * (a.first - b.first) +
1LL * (a.second - b.second) * (a.second - b.second);
}
long long area(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
return 1LL * a.first * b.second + 1LL * a.second * c.first +
1LL * b.first * c.second - 1LL * b.second * c.first -
1LL * a.second * b.first - 1LL * a.first * c.second;
}
int main() {
cin >> a.first >> a.second >> b.first >> b.second >> c.first >> c.second;
if (dist(a, b) == dist(b, c) && area(a, b, c) != 0)
cout << "Yes\n";
else
cout << "No\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return ((a * b) / gcd(a, b)); }
int main() {
long double x1, y1, x2, y2, x3, y3;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
long double d1, d2, d3;
d1 = ((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1));
d1 = sqrt(d1);
d2 = ((x2 - x3) * (x2 - x3)) + ((y2 - y3) * (y2 - y3));
d2 = sqrt(d2);
d3 = ((x3 - x1) * (x3 - x1)) + ((y3 - y1) * (y3 - y1));
d3 = sqrt(d3);
if (d1 + d2 == d3 || d2 + d3 == d1 || d3 + d1 == d2) {
cout << "No" << endl;
return 0;
}
vector<long double> v;
v.push_back(d1);
v.push_back(d2);
v.push_back(d3);
if (d1 == d2) {
cout << "Yes";
} else {
cout << "No";
}
return 0;
}
|
#include <bits/stdc++.h>
int main() {
double a[2], b[2], c[2];
scanf("%lf %lf %lf %lf %lf %lf", &a[0], &a[1], &b[0], &b[1], &c[0], &c[1]);
if ((a[0] * (b[1] - c[1])) - (a[1] * (b[0] - c[0])) +
((b[0] * c[1]) - (b[1] * c[0])) ==
0)
printf("No\n");
else if (pow(a[0] - b[0], 2) + pow(a[1] - b[1], 2) !=
pow(b[0] - c[0], 2) + pow(b[1] - c[1], 2))
printf("No\n");
else
printf("Yes\n");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
double ax, ay, bx, by, cx, cy;
double kab, kbc, kac, lab, lac, lbc;
int main() {
scanf("%lf%lf%lf%lf%lf%lf", &ax, &ay, &bx, &by, &cx, &cy);
if (ax == bx && bx == cx) {
printf("No\n");
return 0;
}
if (ay == by && by == cy) {
printf("No\n");
return 0;
}
lab = (ax - bx) * (ax - bx) + (ay - by) * (ay - by);
lbc = (bx - cx) * (bx - cx) + (by - cy) * (by - cy);
kab = (by - ay) * (bx - cx);
kbc = (by - cy) * (bx - ax);
if (kab != kbc && lab == lbc)
printf("Yes\n");
else
printf("No\n");
}
|
#include <bits/stdc++.h>
using namespace std;
bool check_prime(long long n) {
long long flag = 0;
for (long long i = 2; i * i <= n; i++) {
if (n % i == 0) {
flag = 1;
break;
}
}
if (n == 1)
return false;
else if (flag == 0 || n == 2 || n == 3) {
return true;
} else {
return false;
}
}
long long BE(long long x, long long n, long long m) {
long long result = 1;
while (n > 0) {
if (n % 2 == 1) result = result * x % m;
x = x * x % m;
n = n / 2;
}
return result;
}
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(0);
long double a, b, c, d, e, f;
cin >> a >> b >> c >> d >> e >> f;
if (((a - c) * (a - c) + (b - d) * (b - d) !=
(e - c) * (e - c) + (f - d) * (f - d)) ||
((a + e) / 2.0 == c && (b + f) / 2.0 == d))
cout << "No" << '\n';
else
cout << "Yes" << '\n';
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long int LINF = 0x3f3f3f3f3f3f3f3fll;
const long double DINF = 1e18;
const long double pi = acos(-1.0);
const long double eps = 1e-12;
bool eq(long double a, long double b) { return abs(a - b) <= eps; }
struct pt {
long double x, y;
pt() {}
pt(long double x, long double y) : x(x), y(y) {}
bool operator<(const pt p) const {
if (!eq(x, p.x)) return x < p.x;
return y < p.y;
}
bool operator==(const pt p) const { return eq(x, p.x) and eq(y, p.y); }
pt operator+(const pt p) const { return pt(x + p.x, y + p.y); }
pt operator-(const pt p) const { return pt(x - p.x, y - p.y); }
pt operator*(const long double c) const { return pt(x * c, y * c); }
pt operator/(const long double c) const { return pt(x / c, y / c); }
};
struct line {
pt p, q;
line() {}
line(pt p, pt q) : p(p), q(q) {}
};
long double dist(pt p, pt q) {
return sqrt(((p.x - q.x) * (p.x - q.x)) + ((p.y - q.y) * (p.y - q.y)));
}
long double dist2(pt p, pt q) {
return ((p.x - q.x) * (p.x - q.x)) + ((p.y - q.y) * (p.y - q.y));
}
long double norm(pt v) { return dist(pt(0, 0), v); }
pt normalize(pt v) {
if (!norm(v)) return v;
v = v / norm(v);
return v;
}
long double dot(pt u, pt v) { return u.x * v.x + u.y * v.y; }
long double cross(pt u, pt v) { return u.x * v.y - u.y * v.x; }
long double sarea(pt p, pt q, pt r) { return cross(q - p, r - q) / 2; }
bool col(pt p, pt q, pt r) { return eq(sarea(p, q, r), 0); }
int paral(pt u, pt v) {
u = normalize(u);
v = normalize(v);
if (eq(u.x, v.x) and eq(u.y, v.y)) return 1;
if (eq(u.x, -v.x) and eq(u.y, -v.y)) return -1;
return 0;
}
bool ccw(pt p, pt q, pt r) { return sarea(p, q, r) > 0; }
pt rotate(pt p, long double th) {
return pt(p.x * cos(th) - p.y * sin(th), p.x * sin(th) + p.y * cos(th));
}
pt rotate90(pt p) { return pt(-p.y, p.x); }
bool isvert(line r) { return eq(r.p.x, r.q.x); }
long double getm(line r) {
if (isvert(r)) return DINF;
return (r.p.y - r.q.y) / (r.p.x - r.q.x);
}
long double getn(line r) {
if (isvert(r)) return DINF;
return r.p.y - getm(r) * r.p.x;
}
bool lineeq(line r, line second) {
return col(r.p, r.q, second.p) and col(r.p, r.q, second.q);
}
bool paraline(line r, line second) {
if (isvert(r) and isvert(second)) return 1;
if (isvert(r) or isvert(second)) return 0;
return eq(getm(r), getm(second));
}
bool isinline(pt p, line r) { return col(p, r.p, r.q); }
bool isinseg(pt p, line r) {
if (p == r.p or p == r.q) return 1;
return paral(p - r.p, p - r.q) == -1;
}
pt proj(pt p, line r) {
if (r.p == r.q) return r.p;
r.q = r.q - r.p;
p = p - r.p;
pt proj = r.q * (dot(p, r.q) / dot(r.q, r.q));
return proj + r.p;
}
pt inter(line r, line second) {
if (paraline(r, second)) return pt(DINF, DINF);
if (isvert(r)) return pt(r.p.x, getm(second) * r.p.x + getn(second));
if (isvert(second)) return pt(second.p.x, getm(r) * second.p.x + getn(r));
long double x = (getn(second) - getn(r)) / (getm(r) - getm(second));
return pt(x, getm(r) * x + getn(r));
}
bool interseg(line r, line second) {
if (paraline(r, second)) {
return isinseg(r.p, second) or isinseg(r.q, second) or
isinseg(second.p, r) or isinseg(second.q, r);
}
pt i = inter(r, second);
return isinseg(i, r) and isinseg(i, second);
}
long double disttoline(pt p, line r) { return dist(p, proj(p, r)); }
long double disttoseg(pt p, line r) {
if (isinseg(proj(p, r), r)) return disttoline(p, r);
return min(dist(p, r.p), dist(p, r.q));
}
long double distseg(line a, line b) {
if (interseg(a, b)) return 0;
long double ret = DINF;
ret = min(ret, disttoseg(a.p, b));
ret = min(ret, disttoseg(a.q, b));
ret = min(ret, disttoseg(b.p, a));
ret = min(ret, disttoseg(b.q, a));
return ret;
}
long double polper(vector<pt> v) {
long double ret = 0;
for (int i = 0; i < (int)((v).size()); i++)
ret += dist(v[i], v[(i + 1) % (int)((v).size())]);
return ret;
}
long double polarea(vector<pt> v) {
long double ret = 0;
for (int i = 0; i < (int)((v).size()); i++)
ret += sarea(pt(0, 0), v[i], v[(i + 1) % (int)((v).size())]);
return abs(ret);
}
bool onpol(pt p, vector<pt> v) {
for (int i = 0; i < (int)((v).size()); i++)
if (isinseg(p, line(v[i], v[(i + 1) % (int)((v).size())]))) return 1;
return 0;
}
bool inpol(pt p, vector<pt> v) {
if (onpol(p, v)) return 1;
int c = 0;
line r = line(p, pt(DINF, pi * DINF));
for (int i = 0; i < (int)((v).size()); i++) {
line second = line(v[i], v[(i + 1) % (int)((v).size())]);
if (interseg(r, second)) c++;
}
return c & 1;
}
bool interpol(vector<pt> v1, vector<pt> v2) {
for (int i = 0; i < (int)((v1).size()); i++)
if (inpol(v1[i], v2)) return 1;
for (int i = 0; i < (int)((v2).size()); i++)
if (inpol(v2[i], v1)) return 1;
return 0;
}
long double distpol(vector<pt> v1, vector<pt> v2) {
if (interpol(v1, v2)) return 0;
long double ret = DINF;
for (int i = 0; i < (int)((v1).size()); i++)
for (int j = 0; j < (int)((v2).size()); j++)
ret = min(ret, distseg(line(v1[i], v1[(i + 1) % (int)((v1).size())]),
line(v2[j], v2[(j + 1) % (int)((v2).size())])));
return ret;
}
vector<pt> convexhull(vector<pt> v) {
vector<pt> l, u;
sort(v.begin(), v.end());
for (int i = 0; i < (int)((v).size()); i++) {
while ((int)((l).size()) > 1 and
!ccw(v[i], l[(int)((l).size()) - 1], l[(int)((l).size()) - 2]))
l.pop_back();
l.push_back(v[i]);
}
for (int i = (int)((v).size()) - 1; i >= 0; i--) {
while ((int)((u).size()) > 1 and
!ccw(v[i], u[(int)((u).size()) - 1], u[(int)((u).size()) - 2]))
u.pop_back();
u.push_back(v[i]);
}
l.pop_back();
u.pop_back();
for (int i = 0; i < (int)((u).size()); i++) l.push_back(u[i]);
return l;
}
pt getcenter(pt a, pt b, pt c) {
b = (a + b) / 2;
c = (a + c) / 2;
return inter(line(b, b + rotate90(a - b)), line(c, c + rotate90(a - c)));
}
long double angle(pt a, pt b, pt c) {
pt x = b - a, y = c - b;
long double C = dot(x, y) / (norm(x) * norm(y));
long double A = cross(x, y);
if (A < 0) C = pi - C;
return acos(C);
}
void le(pt& a) { scanf("%Lf %Lf", &a.x, &a.y); }
int main() {
pt a, b, c;
le(a), le(b), le(c);
if (eq(dist(a, b), dist(b, c)) and !col(a, b, c))
printf("Yes\n");
else
printf("No\n");
return 0;
}
|
#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:512000000")
using namespace std;
const long long MAX = 100000000LL * 100000000LL;
const long long MIN = numeric_limits<long long>::min();
const double PI = 3.14159265358979;
const long long MOD = 1000000007LL;
template <class T>
ostream& operator<<(ostream& out, vector<T>& v) {
for (int i = 0; i < v.size(); ++i) out << v[i] << " ";
return out;
}
template <class T>
istream& operator>>(istream& in, vector<T>& v) {
for (int i = 0; i < v.size(); ++i) in >> v[i];
return in;
}
template <class L, class R>
istream& operator>>(istream& in, pair<L, R>& p) {
in >> p.first >> p.second;
return in;
}
template <class T>
T lexical_cast(string& s) {
stringstream ss(s);
T t;
ss >> t;
return t;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long cdiv(long long a, long long b) { return (a + b - 1) / b; }
long long inv(long long n, long long mod) {
long long pow = mod - 2;
long long ans = 1;
long long cur = n;
while (pow > 0) {
if (pow & 1) {
ans *= cur;
ans %= mod;
}
pow /= 2;
cur *= cur;
cur %= mod;
}
return ans;
}
template <class Cont>
void sort(Cont& c) {
sort(begin(c), end(c));
}
template <class Cont>
void reverse(Cont& c) {
reverse(begin(c), end(c));
}
void add_number(long long n, vector<int>& primes) {
for (int i = 2; i * i <= n; ++i) {
if (n % i == 0) {
primes[i]++;
while (n % i == 0) {
n /= i;
}
}
}
if (n > 1) {
primes[n]++;
}
}
int main() {
ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
long long ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
ax -= bx;
cx -= bx;
ay -= by;
cy -= by;
long long rot = ax * cy - ay * cx;
long long dist1 = ax * ax + ay * ay;
long long dist2 = cx * cx + cy * cy;
cout << ((rot == 0) || (dist1 != dist2) ? "No" : "Yes");
}
|
#include <bits/stdc++.h>
using namespace std;
char s[500000];
int a[100000];
int main() {
long long ax, ay, bx, by, cx, cy;
scanf("%lld%lld%lld%lld%lld%lld", &ax, &ay, &bx, &by, &cx, &cy);
if ((ax - bx) * (by - cy) == (ay - by) * (bx - cx)) {
printf("No\n");
} else {
if ((ax - bx) * (ax - bx) + (ay - by) * (ay - by) ==
(by - cy) * (by - cy) + (bx - cx) * (bx - cx)) {
printf("Yes\n");
} else
printf("No\n");
}
}
|
#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
int double_cmp(double a) {
if (fabs(a) < eps) return 0;
return a > 0 ? 1 : -1;
}
int main() {
double ax, ay, bx, by, cx, cy;
while (scanf("%lf %lf %lf %lf %lf %lf", &ax, &ay, &bx, &by, &cx, &cy) !=
EOF) {
double midx = (ax + cx) / 2;
double midy = (ay + cy) / 2;
if (double_cmp(midx - bx) == 0 && double_cmp(midy - by) == 0) {
puts("No");
continue;
}
double up = (ay - cy) * (by - midy);
double down = (ax - cx) * (bx - midx) * (-1);
if (double_cmp(up - down) == 0)
puts("Yes");
else
puts("No");
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long ax, ay, bx, by, cx, cy, d_ab, d_bc, d_ac, flag;
cin >> ax >> ay >> bx >> by >> cx >> cy;
d_ab = (bx - ax) * (bx - ax) + (by - ay) * (by - ay);
d_bc = (cx - bx) * (cx - bx) + (cy - by) * (cy - by);
d_ac = (cx - ax) * (cx - ax) + (cy - ay) * (cy - ay);
flag = abs(ax * by + bx * cy + cx * ay - ay * bx - by * cx - ax * cy);
if (flag && d_ab == d_bc)
cout << "Yes";
else
cout << "No";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long a, a1, b, b1, c, c1;
bool kiemtra() {
long long n = b - a, n1 = b1 - a1, m = c - b, m1 = c1 - b1;
if (n * m1 == n1 * m) return false;
return true;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> a >> a1 >> b >> b1 >> c >> c1;
if ((b - a) * (b - a) + (b1 - a1) * (b1 - a1) ==
(c - b) * (c - b) + (c1 - b1) * (c1 - b1) &&
kiemtra())
cout << "YES";
else
cout << "NO";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long ax, ay, bx, by, cx, cy;
int main() {
scanf("%lld%lld%lld%lld%lld%lld", &ax, &ay, &bx, &by, &cx, &cy);
if ((by - ay) * (bx - cx) != (by - cy) * (bx - ax) &&
(cy - by) * (cy - by) + (cx - bx) * (cx - bx) ==
(bx - ax) * (bx - ax) + (by - ay) * (by - ay))
printf("Yes\n");
else
printf("No\n");
}
|
#include <bits/stdc++.h>
using namespace std;
int inf = (1e9) + 7;
long long sqr(long long x) { return x * x; }
int main() {
long long ax, ay;
long long bx, by;
long long cx, cy;
cin >> ax >> ay;
cin >> bx >> by;
cin >> cx >> cy;
long long d1 = sqr(ax - bx) + sqr(ay - by);
long long d2 = sqr(cx - bx) + sqr(cy - by);
if (d1 == d2 and ((ay - by) * (bx - cx) != (by - cy) * (ax - bx)))
printf("Yes\n");
else
printf("No\n");
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
double ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
long long int dist1 = ((by - ay) * (by - ay)) + ((bx - ax) * (bx - ax));
long long int dist2 = ((cy - by) * (cy - by)) + ((cx - bx) * (cx - bx));
double slope1;
double slope2;
if (bx == ax)
slope1 = 12312414134134;
else {
slope1 = (by - ay) / (bx - ax);
}
if (cx == bx)
slope2 = 12312414134134;
else
slope2 = (cy - by) / (cx - bx);
if (dist1 == dist2 && slope1 != slope2) {
cout << "yes\n";
} else
cout << "no\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
double dx, dy;
long double x[10], y[10];
long double dist(int i, int j) {
return sqrtl((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
}
int main() {
double EPS = std::numeric_limits<long double>::epsilon();
for (int i = 0; i < 3; i++) {
scanf(" %lf %lf", &dx, &dy);
x[i] = dx;
y[i] = dy;
}
long double a = dist(0, 1), b = dist(1, 2), c = dist(0, 2);
long double mx = a;
if (fabs(a - b) < EPS && fabs(c - (a + b)) > EPS) {
printf("YES\n");
} else {
printf("NO\n");
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
long long ab = (ax - bx) * (ax - bx) + (ay - by) * (ay - by);
long long bc = (cx - bx) * (cx - bx) + (cy - by) * (cy - by);
if (ab != bc) {
cout << "No\n";
return 0;
}
if ((ax - bx) * (by - cy) == (ay - by) * (bx - cx))
cout << "No\n";
else
cout << "Yes\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
struct po {
long long x, y;
} A, B, C, n, m;
int main() {
scanf("%I64d%I64d%I64d%I64d%I64d%I64d", &A.x, &A.y, &B.x, &B.y, &C.x, &C.y);
n.x = B.x - A.x;
n.y = B.y - A.y;
m.x = C.x - B.x;
m.y = C.y - B.y;
if ((n.x * n.x + n.y * n.y == m.x * m.x + m.y * m.y) &&
(n.x * m.y != n.y * m.x))
puts("YES");
else
puts("NO");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
const char* comma = strchr(names + 1, ',');
cerr.write(names, comma - names) << " : " << arg1 << " | ";
__f(comma + 1, args...);
}
bool cmpManh(const std::pair<long long, long long>& l,
const std::pair<long long, long long>& r) {
return ((llabs(l.first) + llabs(l.second)) <
(llabs(r.first) + llabs(r.second)));
}
int gcd(int a, int b) {
if (a == 0) return b;
return gcd(b % a, a);
}
int main(void) {
long long int ax, ay, bx, by, cx, cy;
cin >> ax >> ay;
cin >> bx >> by;
cin >> cx >> cy;
long long int da = (ax - bx) * (ax - bx) + (ay - by) * (ay - by);
long long int dc = (cx - bx) * (cx - bx) + (cy - by) * (cy - by);
long long int db = (cx - ax) * (cx - ax) + (cy - ay) * (cy - ay);
long long int x1 = ax;
long long int y1 = ay;
long long int x2 = bx;
long long int y2 = by;
long long int x3 = cx;
long long int y3 = cy;
if (da == dc && ((x3 - x2) * (y2 - y1)) != ((y3 - y2) * (x2 - x1))) {
cout << "Yes" << '\n';
} else {
cout << "No" << '\n';
}
return (0);
}
|
#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-12;
struct dot {
long double x, y;
long long ind;
};
bool operator<(dot a, dot b) { return a.ind < b.ind; }
long double len(dot a, dot b) {
return sqrtl((b.x - a.x) * (b.x - a.x) + (b.y - a.y) * (b.y - a.y));
}
bool eq(long double a, long double b) { return a - EPS <= b && a + EPS >= b; }
int main() {
vector<dot> dots(3);
for (long long i = 0; i < 3; i++) {
cin >> dots[i].x >> dots[i].y;
dots[i].ind = i;
}
bool flag = 0;
long double k1 = (dots[0].y - dots[2].y) / (dots[0].x - dots[2].x), b1;
b1 = dots[0].y - k1 * dots[0].x;
if (eq(len(dots[0], dots[1]), len(dots[2], dots[1])) &&
!eq(len(dots[0], dots[2]),
len(dots[0], dots[1]) + len(dots[1], dots[2]))) {
flag = 1;
}
if (flag) {
cout << "Yes";
} else {
cout << "No";
}
cin >> dots[0].x;
return 0;
}
|
#include <bits/stdc++.h>
struct Vector {
long long int x, y;
Vector() : x(0), y(0) {}
Vector(const Vector& a, const Vector& b) : x(b.x - a.x), y(b.y - a.y) {}
double len() { return hypot(x, y); }
};
long long int cross(Vector& a, Vector& b);
long long int cross(Vector& a, Vector& b) { return a.x * b.y - a.y * b.x; }
int main() {
Vector a, b, c;
std::cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y;
Vector ba(b, a), bc(b, c);
if ((ba.x * ba.x + ba.y * ba.y != bc.x * bc.x + bc.y * bc.y) ||
(cross(ba, bc) == 0))
std::cout << "No";
else
std::cout << "Yes";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a1, a2, b1, b2, c1, c2;
cin >> a1 >> a2 >> b1 >> b2 >> c1 >> c2;
if (a1 * (b2 - c2) + b1 * (c2 - a2) + c1 * (a2 - b2) == 0) {
cout << "No";
return 0;
} else if (((a1 - b1) * (a1 - b1) + (a2 - b2) * (a2 - b2)) ==
((c1 - b1) * (c1 - b1) + (c2 - b2) * (c2 - b2))) {
cout << "Yes";
return 0;
}
cout << "No";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
double dist(pair<double, double> p, pair<double, double> q) {
return sqrt(pow(p.first - q.first, 2) + pow(p.second - q.second, 2));
}
double dot(pair<double, double> p, pair<double, double> q) {
return p.first * q.first + p.second * q.second;
}
pair<double, double> a, b, c;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
for (int i = 0; i < (3); ++i) {
double x, y;
cin >> x >> y;
if (i == 0)
a = make_pair(x, y);
else if (i == 1)
b = make_pair(x, y);
else
c = make_pair(x, y);
}
double distba = dist(a, b);
double distbc = dist(b, c);
if (distba != distbc) {
cout << "No" << endl;
} else {
if ((b.first - c.first) * (b.second - a.second) ==
(b.second - c.second) * (b.first - a.first)) {
cout << "No" << endl;
} else
cout << "Yes" << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long inline gcd(long long x, long long y) {
return !y ? (long long)abs(x) : gcd(y, x % y);
}
long long inline lcm(long long a, long long b) {
return ((long long)abs((a / gcd(a, b)) * b));
}
double inline cartesian_dist(double x1, double y1, double x2, double y2) {
return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
long long bigmod(long long b, long long p, long long m) {
if (!p)
return 1 % m;
else if (p & 1)
return (((b % m) + m) % m * bigmod(b, p - 1, m)) % m;
else {
long long ret = bigmod(b, p / 2, m);
return (ret * ret) % m;
}
}
long long inverse(long long a, long long m) { return bigmod(a, m - 2, m); }
long long extended(long long a, long long m) {
long long oldr = a, r = m, oldans = 1, ans = 0, quotient;
while (r) {
quotient = oldr / r;
oldr = oldr - r * quotient;
swap(oldr, r);
oldans = oldans - ans * quotient;
swap(oldans, ans);
}
return ((oldans % m) + m) % m;
}
const double PI = acos(-1.0);
const double eps = 10E-12;
long long MOD = 101LL;
long long ax, ay, bx, by, cx, cy;
bool check1() {
return (ax - bx) * (ax - bx) + (ay - by) * (ay - by) ==
(bx - cx) * (bx - cx) + (by - cy) * (by - cy);
}
bool check2() { return (ay - by) * (ax - cx) != (ay - cy) * (ax - bx); }
int main() {
cin >> ax >> ay >> bx >> by >> cx >> cy;
if (check1() && check2())
cout << "Yes\n" << endl;
else
cout << "No\n" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long double a, b, c, d, e, f, x, y;
cin >> a >> b >> c >> d >> e >> f;
if (c - a == 0)
x = 10e9 + 7;
else
x = (d - b) / (c - a);
if (e - c == 0)
y = 10e9 + 7;
else
y = (f - d) / (e - c);
if (x == y) {
cout << "No";
return 0;
}
x = sqrt(pow(d - b, 2) + pow(c - a, 2)),
y = sqrt(pow(f - d, 2) + pow(e - c, 2));
if (x != y) {
cout << "No";
return 0;
}
cout << "Yes";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long ax, ay, bx, by, cx, cy;
int main() {
scanf("%lld%lld%lld%lld%lld%lld", &ax, &ay, &bx, &by, &cx, &cy);
long long d0x = ax - bx, d0y = ay - by, d1x = ax - cx, d1y = ay - cy;
if (d0x * d1y == d1x * d0y)
puts("No");
else {
d1x = bx - cx, d1y = by - cy;
if (d0x * d0x + d0y * d0y == d1x * d1x + d1y * d1y)
puts("Yes");
else
puts("No");
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int main() {
long long ax, ay, bx, by, cx, cy;
scanf("%I64d %I64d %I64d %I64d %I64d %I64d", &ax, &ay, &bx, &by, &cx, &cy);
long long ab = ((ax - bx) * (ax - bx) + (ay - by) * (ay - by));
long long bc = ((cx - bx) * (cx - bx) + (cy - by) * (cy - by));
if (ab == bc && ((ax - bx) * (cy - by) != (ay - by) * (cx - bx)))
cout << "Yes" << endl;
else
cout << "No" << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
double ax, ay, bx, by, cx, cy;
scanf("%lf%lf%lf%lf%lf%lf", &ax, &ay, &bx, &by, &cx, &cy);
double a = sqrt((ax - bx) * (ax - bx) + (ay - by) * (ay - by));
double b = sqrt((cx - bx) * (cx - bx) + (cy - by) * (cy - by));
double area = (ax * (by - cy) + bx * (cy - ay) + cx * (ay - by)) / 2;
if (a == b && abs(area) > 0)
printf("Yes");
else
printf("No");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
template <class T>
T min(T a, T b, T c) {
return min(a, min(b, c));
}
template <class T>
T min(T a, T b, T c, T d) {
return min(a, min(b, min(c, d)));
}
template <class T>
T max(T a, T b, T c) {
return max(a, max(b, c));
}
template <class T>
T max(T a, T b, T c, T d) {
return max(a, max(b, max(c, d)));
}
bool cmp(const pair<int, int>& a, const pair<int, int>& b) {
return (a.first > b.first || (a.first == b.first && a.second >= b.second));
}
long long GCD(long long a, long long b) { return (a % b) ? GCD(b, a % b) : b; }
const string namePro = "tmp";
string To_string(long long x) {
if (!x) return "0";
string str = "";
while (x) {
str += x % 10 + '0';
x /= 10;
}
reverse(str.begin(), str.end());
return str;
}
string mul(string a, string b) {
string res = "";
bool isNegative =
((a[0] == '-' && b[0] != '-') || (a[0] != '-' && b[0] == '-'));
if (a[0] == '-') a.erase(0, 1);
if (b[0] == '-') b.erase(0, 1);
int n = a.size();
int m = b.size();
int len = n + m;
int carry = 0;
for (int i = (len - 1); i >= (0); --i) {
int tmp = 0;
for (int j = (n - 1); j >= (0); --j) {
if (i - j <= m && i - j >= 1) {
int a1 = a[j] - '0';
int b1 = b[i - j - 1] - '0';
tmp += a1 * b1;
}
}
tmp += carry;
carry = tmp / 10;
res += (char)(tmp % 10 + '0');
}
reverse(res.begin(), res.end());
while (res.size() > 1 && res[0] == '0') res.erase(0, 1);
if (isNegative) res = "-" + res;
return res;
}
int main() {
long long a_x, a_y, b_x, b_y, c_x, c_y;
scanf("%lld%lld %lld%lld %lld%lld", &a_x, &a_y, &b_x, &b_y, &c_x, &c_y);
long long a = (b_x - c_x) * (b_x - c_x) + (b_y - c_y) * (b_y - c_y);
long long b = (a_x - c_x) * (a_x - c_x) + (a_y - c_y) * (a_y - c_y);
long long c = (a_x - b_x) * (a_x - b_x) + (a_y - b_y) * (a_y - b_y);
vector<long long> vc;
double eps = 1e-9;
vc.push_back(a);
vc.push_back(b);
vc.push_back(c);
sort(vc.rbegin(), vc.rend());
long long delta = vc[0] - vc[1] - vc[2];
string res1 = mul("4", mul(To_string(vc[2]), To_string(vc[1])));
string res2 = mul(To_string(delta), To_string(delta));
if ((res1.size() < res2.size()) ||
(res1.size() == res2.size() && res1 <= res2)) {
puts("No");
return 0;
}
if (a == c)
puts("Yes");
else
puts("No");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long int x1, y1, x2, y2, x3, y3;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
long long int one = x1 * (y2 - y3);
long long int two = x2 * (y3 - y1);
long long int three = x3 * (y1 - y2);
long long int area = one + two + three;
long long int d1 = pow((x1 - x2), 2) + pow((y1 - y2), 2);
long long int d2 = pow((x3 - x2), 2) + pow((y3 - y2), 2);
if ((d1 == d2) && (abs(area) != 0))
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const int maxn = 1e3 + 7;
int n, m;
long long xa, ya, xb, yb, xc, yc;
bool ok() { return (ya - yb) * (xb - xc) == (xa - xb) * (yb - yc); }
int main() {
while (scanf("%lld%lld%lld%lld%lld%lld", &xa, &ya, &xb, &yb, &xc, &yc) !=
EOF) {
long long acx = xa + xc, acy = ya + yc;
long long x1 = acx - xb * 2, y8687969 = acy - yb * 2;
long long x2 = xa - xc, y2 = ya - yc;
if (!ok() && x1 * x2 + y8687969 * y2 == 0)
puts("YES");
else
puts("NO");
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int main() {
long long ax, ay, bx, by, cx, cy;
while (scanf("%I64d%I64d%I64d%I64d%I64d%I64d", &ax, &ay, &bx, &by, &cx,
&cy) != EOF) {
if (((ax - bx) * (ax - bx) + (ay - by) * (ay - by)) ==
((bx - cx) * (bx - cx) + (by - cy) * (by - cy))) {
if ((2 * bx == ax + cx) && (2 * by == ay + cy)) {
printf("No\n");
} else {
printf("Yes\n");
}
} else {
printf("No\n");
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long ax, ay, bx, by, cx, cy;
long long dis(long long x, long long y, long long xx, long long yy) {
return (xx - x) * (xx - x) + (yy - y) * (yy - y);
}
int main() {
cin >> ax >> ay >> bx >> by >> cx >> cy;
if (ax == bx && bx == cx && ay == by && by == cy) {
cout << "No";
return 0;
}
if (dis(ax, ay, bx, by) == dis(bx, by, cx, cy)) {
if (abs(cy - ay) == 2 * abs(by - ay) && abs(cx - ax) == 2 * abs(bx - ax)) {
cout << "No";
} else {
cout << "Yes";
}
} else {
cout << "No";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
double ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
double absq = (ax - bx) * (ax - bx) + (ay - by) * (ay - by);
double cbs = (cx - bx) * (cx - bx) + (cy - by) * (cy - by);
double acs = (ax - cx) * (ax - cx) + (ay - cy) * (ay - cy);
if (absq == cbs) {
double iv = acs / absq;
double cl = (0.5) * (iv);
cl -= 1;
if (abs(cl) < 1) {
cout << "Yes";
} else {
cout << "No";
}
} else {
cout << "No";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, k, t, a1, a2, b1, b2, c1, c2;
cin >> a1 >> a2 >> b1 >> b2 >> c1 >> c2;
long long d1 = (a1 - b1) * (a1 - b1) + (a2 - b2) * (a2 - b2);
long long d2 = (c1 - b1) * (c1 - b1) + (c2 - b2) * (c2 - b2);
if (d1 == d2) {
if (((a1 - b1) == (b1 - c1)) && ((a2 - b2) == (b2 - c2)))
cout << "No";
else
cout << "Yes";
} else
cout << "No";
}
|
#include <bits/stdc++.h>
using namespace std;
long long x[3], y[3], h, k, a[3][3];
int main(int argc, const char* argv[]) {
for (int i = 0; i < 3; i++) cin >> x[i] >> y[i];
long double a1 =
(x[0] - x[1]) * ((x[0] - x[1])) + (y[0] - y[1]) * (y[0] - y[1]);
a1 = sqrt(a1);
long double a2 =
(x[1] - x[2]) * ((x[1] - x[2])) + (y[1] - y[2]) * (y[1] - y[2]);
a2 = sqrt(a2);
long double a3 =
(x[0] - x[2]) * ((x[0] - x[2])) + (y[0] - y[2]) * (y[0] - y[2]);
a3 = sqrt(a3);
if (a1 == a2 && a1 + a2 != a3)
cout << "Yes\n";
else
cout << "No\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int const INF = numeric_limits<int>::max();
long long const LLINF = numeric_limits<long long>::max();
long double const EPS = 1e-9;
long long det(long long xa, long long ya, long long xb, long long yb,
long long xc, long long yc) {
return xa * yb + xb * yc + xc * ya - xc * yb - xa * yc - xb * ya;
}
long long dist2(long long xa, long long ya, long long xb, long long yb) {
return (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
}
int main() {
ios::sync_with_stdio(false);
long long xa, xb, xc, ya, yb, yc;
cin >> xa >> ya >> xb >> yb >> xc >> yc;
if (det(xa, ya, xb, yb, xc, yc) == 0)
cout << "No" << endl;
else if (dist2(xa, ya, xb, yb) == dist2(xb, yb, xc, yc))
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
long long x1, x2, x3, y1, y2, y3;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
if ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) ==
(y3 - y2) * (y3 - y2) + (x3 - x2) * (x3 - x2) &&
(y3 - y2) * (x2 - x1) != (y2 - y1) * (x3 - x2))
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long vx[3];
long long vy[3];
long long dis(long long a, long long b) {
return (vx[a] - vx[b]) * (vx[a] - vx[b]) + (vy[a] - vy[b]) * (vy[a] - vy[b]);
}
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
for (long long i = 0; i < 3; i++) {
cin >> vx[i] >> vy[i];
}
if (vx[1] - vx[0] == vx[2] - vx[1] && vy[1] - vy[0] == vy[2] - vy[1]) {
cout << "No\n";
} else if (dis(0, 1) == dis(1, 2))
cout << "Yes\n";
else
cout << "No\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T x, T y) {
return y == 0 ? x : gcd(y, x % y);
}
template <typename T>
T lcm(const T &a, const T &b) {
return (a * b) / gcd(a, b);
}
long long int ax, ay, bx, by, cx, cy;
long long int d1, d2, dx1, dx2;
long double m1, m2;
int main() {
std::ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
;
cin >> ax >> ay >> bx >> by >> cx >> cy;
d1 = (by - ay) * (by - ay) + (bx - ax) * (bx - ax);
d2 = (cy - by) * (cy - by) + (cx - bx) * (cx - bx);
dx1 = (bx - ax);
dx2 = (cx - bx);
if (dx1 == 0 && dx2 == 0) {
cout << "NO\n";
return 0;
}
if ((dx1 == 0 && dx2 != 0) || (dx1 == 0 && dx2 != 0)) {
if (d1 == d2) {
cout << "YES\n";
} else
cout << "NO\n";
return 0;
}
m1 = ((double)(by - ay) / (bx - ax));
m2 = ((double)(cy - by) / (cx - bx));
cout << ((m1 != m2 && d1 == d2) ? "YES\n" : "NO\n");
return 0;
}
|
#include <bits/stdc++.h>
const long long mod = 1e8 + 7;
using namespace std;
long long ax, ay, bx, by, cx, cy;
int main() {
cin >> ax >> ay >> bx >> by >> cx >> cy;
if ((bx - ax) * (bx - ax) + (by - ay) * (by - ay) ==
(bx - cx) * (bx - cx) + (by - cy) * (by - cy)) {
if (ax + cx == 2 * bx && ay + cy == 2 * by)
cout << "NO";
else
cout << "YES";
} else
cout << "NO";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int x1, x2, x3, y1, y2, y3;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
long long int ab = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
long long int ac = (x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3);
long long int bc = (x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3);
long long int ar = (x1 - x3) * (y2 - y1) - (x1 - x2) * (y3 - y1);
if (ar == 0 || ab != bc) {
cout << "No";
exit(0);
}
cout << "Yes";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
long long dist2(long long x1, long long y1, long long x2, long long y2) {
return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
}
int main() {
long long xa, ya, xb, yb, xc, yc;
cin >> xa >> ya >> xb >> yb >> xc >> yc;
if (abs((yb - ya) * (xc - xb)) == abs((yc - yb) * (xb - xa)) &&
abs(((yb - yc) * (xa - xc))) == abs((ya - yc) * (xb - xc)))
cout << "No\n";
else {
if (dist2(xa, ya, xb, yb) == dist2(xb, yb, xc, yc))
cout << "Yes\n";
else
cout << "No\n";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
std::ios_base::sync_with_stdio(0);
cin.tie(0);
long long ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
long double dist1 = ((by - ay) * (by - ay) + (bx - ax) * (bx - ax));
long double dist2 = ((by - cy) * (by - cy) + (bx - cx) * (bx - cx));
if (((by - ay) * (bx - cx)) == ((bx - ax) * (by - cy))) {
cout << "No" << endl;
} else {
if (dist1 == dist2)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
}
|
#include <bits/stdc++.h>
using namespace std;
long long p[3][2];
inline long long dist(long long i, long long j) {
return (p[i][0] - p[j][0]) * (p[i][0] - p[j][0]) +
(p[i][1] - p[j][1]) * (p[i][1] - p[j][1]);
}
inline long long det() {
return (p[0][0] - p[1][0]) * (p[1][1] - p[2][1]) -
(p[0][1] - p[1][1]) * (p[1][0] - p[2][0]);
}
int main() {
for (int i = 0; i < 3; ++i)
for (int j = 0; j < 2; ++j) cin >> p[i][j];
if (dist(0, 1) == dist(1, 2) && det())
puts("Yes");
else
puts("No");
return 0;
}
|
#include <bits/stdc++.h>
long long int ax, ay, bx, by, cx, cy;
int main() {
scanf("%I64d%I64d%I64d%I64d%I64d%I64d", &ax, &ay, &bx, &by, &cx, &cy);
long long int s1, s2, s3;
s1 = (ax - bx) * (ax - bx) + (ay - by) * (ay - by);
s3 = (cx - bx) * (cx - bx) + (cy - by) * (cy - by);
if (bx * 2 == (ax + cx) && by * 2 == (ay + cy))
printf("No\n");
else if (s1 == s3)
printf("Yes\n");
else
printf("No\n");
}
|
#include <bits/stdc++.h>
using namespace std;
struct Point {
long double x, y;
Point(){};
long double dist(Point b) {
return sqrt((b.x - x) * (b.x - x) + (b.y - y) * (b.y - y));
}
};
int main() {
Point a, b, c;
cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y;
long double k = a.dist(b);
long double l = c.dist(b);
if (k == l && k + l != a.dist(c))
cout << "YES";
else
cout << "NO";
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a1, a2, b1, b2, c1, c2;
cin >> a1 >> a2 >> b1 >> b2 >> c1 >> c2;
long long x = (a1 - b1) * (a1 - b1) + (a2 - b2) * (a2 - b2),
y = (b1 - c1) * (b1 - c1) + (b2 - c2) * (b2 - c2);
if (x != y)
cout << "No" << endl;
else {
if ((a2 - b2) * (c1 - b1) == (a1 - b1) * (c2 - b2))
cout << "No" << endl;
else
cout << "Yes" << endl;
}
}
|
#include <bits/stdc++.h>
int main() {
long ax, ay, bx, by, cx, cy;
double dx, dy;
bool vis1, vis2;
scanf("%ld%ld%ld%ld%ld%ld", &ax, &ay, &bx, &by, &cx, &cy);
if (ax == cx && ay == cy) {
printf("Yes\n");
return 0;
}
if (ax + cx == bx * 2 && ay + cy == by * 2) {
printf("No\n");
return 0;
}
if (cx - ax != 0)
vis1 = true;
else
vis1 = false;
dx = 1.0 * (ax + cx) / 2;
dy = 1.0 * (ay + cy) / 2;
if (fabs(bx - dx) > 0.00000000001)
vis2 = true;
else
vis2 = false;
if ((vis1 == false && vis2 == true && fabs(by - dy) < 0.00000000001) ||
(vis1 == true && fabs(cy - ay) < 0.00000000001 && vis2 == false) ||
(vis1 == true && vis2 == true &&
(cy - ay) * (by - dy) == -(cx - ax) * (bx - dx)))
printf("Yes\n");
else
printf("No\n");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
if ((ax - bx) * (ax - bx) + (ay - by) * (ay - by) ==
(bx - cx) * (bx - cx) + (by - cy) * (by - cy) &&
(ay - by) * 1.0 / (ax - bx) != (by - cy) * 1.0 / (bx - cx))
cout << "yes\n";
else
cout << "no\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
double ax, ay, bx, by, cx, cy, aa, bb, cc;
cin >> ax >> ay >> bx >> by >> cx >> cy;
aa = (ax - bx) * (ax - bx) + (ay - by) * (ay - by);
bb = (bx - cx) * (bx - cx) + (by - cy) * (by - cy);
cc = (ax - cx) * (ax - cx) + (ay - cy) * (ay - cy);
aa = sqrt(aa);
bb = sqrt(bb);
cc = sqrt(cc);
if (aa - bb == 0) {
if (aa + bb == cc) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
} else {
cout << "No" << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long ax, ay, bx, by, cx, cy;
int main() {
cin >> ax >> ay >> bx >> by >> cx >> cy;
if ((ax - bx) * (ax - bx) + (ay - by) * (ay - by) ==
(cx - bx) * (cx - bx) + (cy - by) * (cy - by) &&
(bx - ax) * (cy - ay) != (cx - ax) * (by - ay))
printf("Yes");
else if ((ax - bx) * (ax - bx) + (ay - by) * (ay - by) ==
(cx - bx) * (cx - bx) + (cy - by) * (cy - by) &&
ax == cx && ay == cy)
printf("Yes");
else
printf("No");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const double eps = 0.000001;
const long double pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const long long MOD = 1e18 + 9;
const long long INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int minn = 1e5 + 9;
const int N = 5e3 + 123;
const int NN = 5e5 + 123;
const int PRI = 555557;
const int pri = 997;
int tests = 1;
int n, m, k, a[NN], cnt, ans;
long long dist(long long x1, long long y1, long long x2, long long y2) {
return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}
inline void Solve() {
long long ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
if (dist(ax, ay, bx, by) == dist(bx, by, cx, cy) &&
!(bx - ax == cx - bx && by - ay == cy - by))
cout << "Yes";
else
cout << "No";
}
int main() {
ios_base::sync_with_stdio(0), cin.tie(0);
while (tests--) {
Solve();
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
long long int ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
long long int a = (ax - cx) * (by - ay) - (ax - bx) * (cy - ay);
if (a) {
long double dab =
sqrt((long double)(ax - bx) * (ax - bx) + (ay - by) * (ay - by));
long double dbc =
sqrt((long double)(bx - cx) * (bx - cx) + (by - cy) * (by - cy));
if (dab == dbc)
cout << "Yes";
else
cout << "No";
} else
cout << "No";
}
|
#include <bits/stdc++.h>
using namespace std;
struct p {
long long x, y;
} po[10];
bool cmp(p a, p b) {
if (a.x != b.x)
return a.x < b.x;
else
return a.y < b.y;
}
long long dist(p a, p b) {
return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
}
int main() {
cin >> po[0].x >> po[0].y >> po[1].x >> po[1].y >> po[2].x >> po[2].y;
long long dis[10];
dis[1] = dist(po[1], po[2]);
dis[2] = dist(po[0], po[1]);
dis[0] = dist(po[0], po[2]);
long long dx1 = po[0].x - po[1].x, dx2 = po[0].x - po[2].x,
dx3 = po[1].x - po[2].x;
long long dy1 = po[0].y - po[1].y, dy2 = po[0].y - po[2].y,
dy3 = po[1].y - po[2].y;
if ((dis[1] == dis[2]) && (dx1 * dy3 - dx3 * dy1 != 0)) {
cout << "Yes" << endl;
} else
cout << "No" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
long long int d1 = (ax - bx) * (ax - bx) + (ay - by) * (ay - by);
long long int d2 = (bx - cx) * (bx - cx) + (by - cy) * (by - cy);
long long int a = (cx - bx) * (by - ay);
long long int b = (cy - by) * (bx - ax);
if (d1 == d2 && a != b)
cout << "Yes\n";
else
cout << "No\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long double ax, ay, bx, by, cx, cy, ab_dis, bc_dis, tmp_1, tmp_2;
cin >> ax >> ay >> bx >> by >> cx >> cy;
ab_dis = (ax - bx) * (ax - bx) + (ay - by) * (ay - by);
bc_dis = (bx - cx) * (bx - cx) + (by - cy) * (by - cy);
if (ab_dis != bc_dis || (by - ay) * (cx - bx) == (cy - by) * (bx - ax))
cout << "No";
else
cout << "Yes";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long int f(long long a1, long long a2, long long b1, long long b2) {
return (b1 - a1) * (b1 - a1) + (b2 - a2) * (b2 - a2);
}
int main() {
long long int ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
if ((bx - ax) * (by - cy) != (bx - cx) * (by - ay) &&
f(ax, ay, bx, by) == f(bx, by, cx, cy))
cout << "Yes";
else
cout << "No";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
long long abx = llabs(ax - bx), aby = llabs(ay - by);
long long cbx = llabs(cx - bx), cby = llabs(cy - by);
if (abx * abx + aby * aby == cbx * cbx + cby * cby &&
(!((ax - bx == bx - cx) && (ay - by == by - cy))))
cout << "Yes" << endl;
else
cout << "No" << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
int64_t len(int64_t ax, int64_t ay, int64_t bx, int64_t by) {
return (bx - ax) * (bx - ax) + (by - ay) * (by - ay);
}
bool collinear(int64_t ax, int64_t ay, int64_t bx, int64_t by, int64_t cx,
int64_t cy) {
return 0 == ax * (by - cy) + bx * (cy - ay) + cx * (ay - by);
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
if (len(ax, ay, bx, by) == len(bx, by, cx, cy) &&
!collinear(ax, ay, bx, by, cx, cy))
cout << "Yes";
else
cout << "No";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
double dis(double ax, double ay, double bx, double by) {
return sqrt(pow(ax - bx, 2) + pow(ay - by, 2));
}
bool f(double a, double b, double c) {
if (a == sqrt(pow(b, 2) + pow(c, 2)))
return true;
else
return false;
}
int main() {
cout << fixed << setprecision(15);
double ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
double ab = dis(ax, ay, bx, by), bc = dis(bx, by, cx, cy),
ac = dis(ax, ay, cx, cy);
bool res = true;
if (ab == bc) {
if (ay - by == 0) {
if (ay == by && ay == cy) res = false;
} else if (ax - bx == 0) {
if (ax == bx && ax == cx) res = false;
} else {
double m = (ay - by) / (ax - bx);
if (cy == (m * cx + ay - m * ax)) res = false;
}
} else
res = false;
if (res)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
struct Point {
long long x;
long long y;
Point(long long x, long long y) : x(x), y(y) {}
};
struct Vect {
int x;
int y;
Vect(Point A, Point B) : x(B.x - A.x), y(B.y - A.y) {}
long long operator*(const Vect &v) const {
return (long long)x * v.y - (long long)y * v.x;
}
};
int main() {
long long ax, ay, bx, by, cx, cy;
scanf("%lld %lld %lld %lld %lld %lld", &ax, &ay, &bx, &by, &cx, &cy);
Point A(ax, ay), B(bx, by), C(cx, cy);
Vect AB(A, B);
Vect BC(B, C);
if (AB * BC == 0)
printf("No");
else if ((ax - bx) * (ax - bx) + (ay - by) * (ay - by) !=
(bx - cx) * (bx - cx) + (by - cy) * (by - cy))
printf("No");
else
printf("Yes");
return 0;
}
|
#include <bits/stdc++.h>
int main() {
long long ax, ay, bx, by, cx, cy;
scanf("%lld%lld%lld%lld%lld%lld", &ax, &ay, &bx, &by, &cx, &cy);
long long lenab = (ay - by) * (ay - by) + (ax - bx) * (ax - bx);
long long lenbc = (by - cy) * (by - cy) + (bx - cx) * (bx - cx);
if ((by - ay) * (cx - ax) == (cy - ay) * (bx - ax))
printf("no");
else if (lenbc == lenab)
printf("yes");
else
printf("no");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
double midx = (double)(ax + cx) / 2.0;
double midy = (double)(ay + cy) / 2.0;
if (midx == bx && midy == by)
cout << "No" << endl;
else {
if (((cx - bx) * (cx - bx) + (cy - by) * (cy - by)) ==
((ax - bx) * (ax - bx) + (ay - by) * (ay - by)))
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 50;
const int INF = 1 << 30;
long long a[2], b[2], c[2];
int main() {
cin >> a[0] >> a[1] >> b[0] >> b[1] >> c[0] >> c[1];
double m0 = (a[0] + c[0]) / 2.0, m1 = (a[1] + c[1]) / 2.0;
double dis1 = (a[1] - c[1]) * (a[1] - c[1]) + (a[0] - c[0]) * (a[0] - c[0]);
dis1 /= 4;
double dis2 = (b[0] - m0) * (b[0] - m0) + (b[1] - m1) * (b[1] - m1);
double ab = (a[1] - b[1]) * (a[1] - b[1]) + (a[0] - b[0]) * (a[0] - b[0]);
double bc = (b[1] - c[1]) * (b[1] - c[1]) + (b[0] - c[0]) * (b[0] - c[0]);
if (ab == bc &&
(c[1] - a[1]) * (b[0] - a[0]) != (c[0] - a[0]) * (b[1] - a[1]))
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
complex<long double> a(ax, ay), b(bx, by), c(cx, cy);
long double d1 = abs(b - a), d2 = abs(c - b);
long double ang1 = arg(b - a), ang2 = arg(c - b);
cout << ((abs(d1 - d2) < EPS && abs(ang1 - ang2) > EPS) ? "Yes" : "No")
<< endl;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
long long d1 = pow(ax - bx, 2) + pow(ay - by, 2);
long long d2 = pow(bx - cx, 2) + pow(by - cy, 2);
long long area_twice = ax * (by - cy) + bx * (cy - ay) + cx * (ay - by);
if (d1 != d2 || !area_twice)
cout << "No" << endl;
else
cout << "Yes" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long size(long long ax, long long ay, long long bx, long long by) {
return (bx - ax) * (bx - ax) + (by - ay) * (by - ay);
}
long long angl(long long ax, long long ay, long long bx, long long by,
long long cx, long long cy) {
return (ax - bx) * (cx - bx) + (ay - by) * (cy - by);
}
int main() {
long long a[2], b[2], c[2];
cin >> a[0] >> a[1];
cin >> b[0] >> b[1];
cin >> c[0] >> c[1];
if (size(a[0], a[1], b[0], b[1]) == size(b[0], b[1], c[0], c[1]) &&
angl(b[0], b[1], a[0], a[1], c[0], c[1]) ==
angl(b[0], b[1], c[0], c[1], a[0], a[1]))
if (abs(size(b[0], b[1], c[0], c[1])) ==
abs(angl(a[0], a[1], b[0], b[1], c[0], c[1])))
cout << "NO"
<< "\n";
else
cout << "YES"
<< "\n";
else
cout << "NO"
<< "\n";
}
|
#include <bits/stdc++.h>
using namespace std;
long long int ax, ay, bx, by, cx, cy;
double k1, k2, k3;
int main() {
long long int dis_ab, dis_ac, dis_bc, max_dis = -1;
cin >> ax >> ay >> bx >> by >> cx >> cy;
dis_ab = (ax - bx) * (ax - bx) + (ay - by) * (ay - by);
k1 = (double)(ax - bx) / (ay - by);
dis_ac = (ax - cx) * (ax - cx) + (ay - cy) * (ay - cy);
k2 = (double)(ax - cx) / (ay - cy);
dis_bc = (bx - cx) * (bx - cx) + (by - cy) * (by - cy);
k3 = (double)(bx - cx) / (by - cy);
if (k1 == k2 && k2 == k3)
cout << "No";
else {
if (dis_ab == dis_bc)
cout << "Yes";
else
cout << "No";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
inline int read(register int ans = 0, register int sgn = ' ',
register int ch = getchar()) {
for (; ch < '0' || ch > '9'; sgn = ch, ch = getchar())
;
for (; ch >= '0' && ch <= '9'; (ans *= 10) += ch - '0', ch = getchar())
;
return sgn - '-' ? ans : -ans;
}
int ax, ay, bx, by, cx, cy;
int main() {
ax = read(), ay = read(), bx = read(), by = read(), cx = read(), cy = read();
if (1ll * (ax - bx) * (ax - bx) + 1ll * (ay - by) * (ay - by) !=
1ll * (bx - cx) * (bx - cx) + 1ll * (by - cy) * (by - cy))
puts("No");
else if (ax - bx == bx - cx && ay - by == by - cy)
puts("No");
else
puts("Yes");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
if ((bx - ax) * (bx - ax) + (by - ay) * (by - ay) !=
(cx - bx) * (cx - bx) + (cy - by) * (cy - by))
cout << "No";
else {
if ((long double)(by - ay) / (bx - ax) ==
(long double)(cy - by) / (cx - bx))
cout << "No";
else
cout << "Yes";
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.