Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bits/stdc++.h>
- //#pragma GCC optimize("O3")
- //#pragma GCC optimize("unroll-loops")
- #define mp make_pair
- #define pb push_back
- #define eb emplace_back
- #define x first
- #define y second
- #define sz(x) (int)x.size()
- #define all(x) begin(x), end(x)
- #define rall(x) rbegin(x), rend(x)
- #define FOR(i,a,b) for (int i = (a); i < (b); i++)
- #define RFOR(i,b,a) for (int i = (b) - 1; i >= (a); i--)
- using namespace std;
- typedef unsigned long long ull;
- typedef long long ll;
- typedef long double ld;
- typedef pair<int, int> pi;
- typedef pair<ll, ll> pl;
- typedef vector<int> veci;
- typedef vector<bool> vecb;
- typedef vector<vector<int>> vvi;
- typedef vector<vector<bool>> vvb;
- const int INF_I = 1e9;
- const ll INF_LL = 1e18;
- const int MOD = 1000000007;
- const double eps = 1e-2;
- const double PI = 22./7;
- ld len(pl a){
- return sqrt(a.x*a.x + a.y*a.y);
- }
- int main() {
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- int n;
- pl a;
- cin >> n >> a.x >> a.y;
- vector<pl> v(n);
- for (int i = 0; i < n; i++)
- cin >> v[i].x >> v[i].y;
- ld sum = 0;
- for (int i = 0; i < n; i++){
- pl v1 = {v[i].x - a.x, v[i].y - a.y};
- pl v2 = {v[(i+1)%n].x - a.x, v[(i+1)%n].y - a.y};
- ld sin = (v1.x*v2.y-v1.y*v2.x) / len(v1) / len(v2);
- sum += asin(sin);
- }
- if (fabs(sum) <= eps)
- cout << "NO\n";
- else
- cout << "YES\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement