Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <iostream>
- #include <iterator>
- #include <map>
- #include <set>
- #include <string>
- #include <vector>
- #include <algorithm>
- #include <stack>
- #include <deque>
- #include <queue>
- #include <climits>
- #define int long long
- #define db double
- #define ff first
- #define ss second
- using namespace std;
- const int MOD = 1e9 + 7;
- // const int INF = LONG_MAX;
- const int INF = INT_MAX;
- const int MAXW = 10001;
- const double PI = 3.14159265358979323846;
- struct Point {
- int x;
- int y;
- Point& operator += (const Point& p) {
- x += p.x;
- y += p.y;
- return *this;
- }
- Point& operator -= (const Point& p) {
- x -= p.x;
- y -= p.y;
- return *this;
- }
- };
- ostream& operator << (ostream& out, Point& p) {
- out << p.x << " " << p.y << '\n';
- return out;
- }
- istream& operator >> (istream& in, Point& p) {
- in >> p.x >> p.y;
- return in;
- }
- struct Vct {
- int x;
- int y;
- Vct& operator += (const Vct& a) {
- x += a.x;
- y += a.y;
- return *this;
- }
- Vct& operator -= (const Vct& a) {
- x -= a.x;
- y -= a.y;
- return *this;
- }
- Vct& operator *= (const int c) {
- x *= c;
- y *= c;
- return *this;
- }
- };
- Vct operator + (const Vct& a, const Vct& b) {
- Vct tmp = a;
- tmp += b;
- return tmp;
- }
- Vct operator - (const Vct& a, const Vct& b) {
- Vct tmp = a;
- tmp -= b;
- return tmp;
- }
- ostream& operator << (ostream& out, Vct& v) {
- out << v.x << " " << v.y << '\n';
- return out;
- }
- istream& operator >> (istream& in, Vct& v) {
- in >> v.x >> v.y;
- return in;
- }
- signed main() {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- Vct f, s;
- cin >> f >> s;
- double ans = abs(atan2(f.y, f.x) - atan2(s.y, s.x));
- if (ans > PI) {
- ans -= PI;
- }
- if (abs(2 * PI - ans) < ans) {
- ans = abs(2 * PI - ans);
- }
- cout.precision(20);
- cout << fixed << ans;
- }
Advertisement
Add Comment
Please, Sign In to add comment