Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- typedef unsigned long long ull;
- #define all(x) x.begin(), x.end()
- #define rall(x) x.rbegin(), x.rend()
- #define endl '\n'
- #define boostIO() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
- ll gcd(ll a, ll b) { return (b == 0 ? a : gcd(b, a % b)); }
- struct pt {
- double x, y;
- };
- struct pt3 {
- double x, y, z;
- };
- double f(double x, double y) {
- return x * x * x - 3 * x * y * y - x * x + y * y + x - 1;
- }
- double g(double x, double y) {
- return 3 * x * x * y - y * y * y - 2 * x * y + y;
- }
- void initial_points() {
- double Xm = -10, Xp = 10, x;
- double Ym = -10, Yp = 10, y;
- float dl = 0.1;
- float curmin = 1000000.;
- while (curmin > 999999) {
- for (x = Xm; x < Xp; x = x + 0.1)
- for (y = Ym; y < Yp; y = y + 0.1) {
- double fc = f(x, y);
- double gc = g(x, y);
- if ((fc <= 0) || (gc <= 0)) continue;
- double dv = fabs(fc) + fabs(gc);
- if (dv > curmin) continue;
- double x0 = x;
- double y0 = y;
- curmin = dv;
- continue;
- }
- if (curmin <= 999999.) break;
- dl = dl / 2;
- }
- cout << x << endl << y << endl;
- }
- signed main() {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement