-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path18A Triangle.cpp
63 lines (56 loc) · 1.52 KB
/
18A Triangle.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
author : MishkatIT
created : Tuesday 2023-11-14-23.26.18
*/
#include<bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define debug(_) cout << #_ << " is " << _ << '\n';
using namespace std;
using ll = long long;
using ld = long double;
const ll mod = 1e9 + 7;
const ll N = 2e5 + 10;
const ll inf = 1e9;
const ll linf = 1e18;
int main()
{
fio;
vector<pair<ll, ll>> v(3), temp;
for (int i = 0; i < 3; i++) {
int x, y;
cin >> x >> y;
v[i] = {x, y};
}
int dx[] = {0, 1, -1, 0, 0};
int dy[] = {0, 0, 0, -1, 1};
int attempt = -1;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 5; j++) {
temp = v;
temp[i].first += dx[j];
temp[i].second += dy[j];
set<pair<int, int>> s(temp.begin(), temp.end());
if (s.size() != 3) continue;
vector<ll> len;
for (int z = 0; z < 3; z++) {
ll xx = (temp[(z + 1) % 3].first - temp[z].first);
ll yy = (temp[(z + 1) % 3].second - temp[z].second);
len.push_back(xx * xx + yy * yy);
}
sort(len.begin(), len.end());
if (len[0] + len[1] == len[2]) {
attempt = j;
// debug(j)
break;
}
}
}
if (attempt == -1) {
cout << "NEITHER";
} else if (attempt == 0) {
cout << "RIGHT";
} else {
cout << "ALMOST";
}
return 0;
}