text stringlengths 49 983k |
|---|
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c, d;
cin >> a >> b >> c;
if (!a && b) {
cout << "1\n";
cout << fixed << setprecision(7) << (-c / b);
return 0;
}
if (!a && !b && !c) {
cout << "-1";
return 0;
}
d = b * b - 4 * a * c;
if (d < 0 || (!a && !b && c... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c;
while (cin >> a >> b >> c) {
if (a == 0 && b == 0) {
if (c == 0)
cout << -1 << endl;
else
cout << 0 << endl;
} else if (a == 0 && c == 0)
cout << 1 << endl << 0 << endl;
else if (b == 0 && c == 0... |
#include <bits/stdc++.h>
using namespace std;
int a, b, c;
int main() {
while (cin >> a >> b >> c) {
if (a == 0) {
if (b == 0) {
if (c == 0)
puts("-1");
else
puts("0");
} else {
double ans = -(double)c / (double)b;
printf("1\n%.5lf\n", ans);
}
... |
#include <bits/stdc++.h>
using namespace std;
double delta(double a, double b, double c) { return b * b - 4 * a * c; }
int main() {
double a, b, c;
cin >> a >> b >> c;
double s1, s2, de = delta(a, b, c);
if (de < 0) {
cout << 0;
return 0;
}
if (!a && !b && !c) {
cout << -1;
return 0;
}
i... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int no = 0;
double a, b, c, res, res1, res2, d, p, q;
scanf("%lf%lf%lf", &a, &b, &c);
if (a == 0 && b == 0 && c == 0) {
cout << "-1" << endl;
return 0;
}
if (a == 0 && b != 0) {
res = -(c / b);
printf("1\n%lf", res);
return 0;
... |
#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T& x) {
x = 0;
char c;
while (!isdigit(c = getchar()))
;
do {
x = x * 10 + c - '0';
} while (isdigit(c = getchar()));
}
template <typename T>
inline void write(T x) {
if (x > 9) write(x / 10);
putchar(x % 10 + 48)... |
#include <bits/stdc++.h>
using namespace std;
int main() {
cout << setprecision(6) << fixed;
double a, b, c;
cin >> a >> b >> c;
if (a == 0) {
if (b == 0) {
if (c == 0) {
cout << -1;
} else {
cout << 0;
}
} else {
cout << 1 << endl;
cout << -c / b;
}
}... |
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 10;
const int N = 1010;
long double a, b, c;
int main() {
ios_base::sync_with_stdio(0);
cout.tie(0);
cin.tie(0);
cin >> a >> b >> c;
long double d = (b * b - 4 * a * c);
if (d < 0) {
cout << 0;
return 0;
}
if (a == b && b == c &... |
#include <bits/stdc++.h>
using namespace std;
template <class T>
T toDec(string s) {
stringstream is(s);
T res;
is >> res;
return res;
}
template <class T>
string toStr(T n) {
string s;
stringstream is;
is << n;
is >> s;
return s;
}
template <class T>
bool isPrime(T x) {
if (x <= 1) return false;
... |
#include <bits/stdc++.h>
using namespace std;
const long long A = 1e16, N = 228228, K = 8;
vector<long double> x;
long double d, a, b, c;
long long i, j, n;
int main() {
cin >> a >> b >> c;
if (!a) {
if (!b && !c) {
puts("-1");
return 0;
;
}
if (!b) {
puts("0");
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 a, b, c;
cin >> a >> b >> c;
if (a == 0 && b == 0 && c == 0) {
printf("-1\n");
} else if (a == 0 && b == 0 && c != 0) {
printf("0\n");
} else if (a == 0 && b != 0) {
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, c;
cin >> a >> b >> c;
if (a == 0) {
if (b == 0) {
if (c == 0)
printf("-1\n");
else
printf("0\n");
} else {
printf("1\n");
printf("%.5lf\n", -1.0 * c / b);
}
} else {
long long sum ... |
#include <bits/stdc++.h>
using namespace std;
const int O = 2e9;
const double E = 1e-9;
const double api = 3.1415926536;
int DX[] = {1, -1, -1, 1};
int DY[] = {-1, 1, 1, -1};
int main() {
long double a, b, c;
cin >> a >> b >> c;
if (a == b && b == c && a == 0) {
cout << -1 << endl;
return 0;
}
if (a =... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, c;
double x1, x2;
cin >> a >> b >> c;
if (a == 0) {
if (b == 0) {
if (c == 0) {
cout << "-1";
return 0;
}
if (c != 0) {
cout << "0";
return 0;
}
} else {
cout << "1" <... |
#include <bits/stdc++.h>
using namespace std;
double a, b, c;
set<double> s;
int main() {
cin >> a >> b >> c;
if (a == 0) {
if (b == 0) {
if (c == 0)
puts("-1");
else
puts("0");
} else {
puts("1");
double ans = -1.0 * c / b;
printf("%0.5f", ans);
}
} else ... |
#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cer... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c, e, f, g, h;
double x1, x2, x3, z, m, d;
cin >> a >> b >> c;
m = ((b * b) - (4 * a * c));
if (m < 0) {
cout << 0 << endl;
} else if (a == 0) {
if (b == 0 && c != 0) {
cout << 0 << endl;
} else if (b == 0 && c == 0) {... |
#include <bits/stdc++.h>
int main() {
long long w, x, y, z;
double a, b;
scanf("%lld %lld %lld", &w, &x, &y);
if (w) {
z = x * x - (4 * w * y);
if (z > 0) {
a = (-x - sqrt(z)) / (2 * w);
b = (-x + sqrt(z)) / (2 * w);
if (w > 0)
printf("2\n%lf\n%lf\n", a, b);
else
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a == 0) {
if (b == 0)
printf(c == 0 ? "-1\n" : "0\n");
else
printf("1\n%f\n", (double)-c / b);
return 0;
}
long long d = (long long)b * b - 4LL * a * c;
if (d < 0)
printf("0\n");
els... |
#include <bits/stdc++.h>
using namespace std;
double a, b, c, x1, x2;
int main() {
int i, j, k, m, n, ans, len;
while (scanf("%lf%lf%lf", &a, &b, &c) != EOF) {
if (fabs(a) < 1e-8) {
if (fabs(b) < 1e-8) {
if (fabs(c) < 1e-8)
printf("-1\n");
else
printf("0\n");
} el... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int a, b, c, x1;
cin >> a >> b >> c;
double y, y1, y2;
if (a == 0 && b == 0 && c == 0)
cout << "-1";
else if (a == 0) {
if (b != 0) {
cout << "1"
<< "\n";
double y = ((double)(-c)) / b;
cout << fixed << s... |
#include <bits/stdc++.h>
using namespace std;
const int Z = (int)1e5 + 111;
const int inf = (int)1e9 + 111;
const long long llinf = (long long)1e18 + 5;
int main() {
ios_base::sync_with_stdio(false);
long double a, b, c;
cin >> a >> b >> c;
if (a == 0 && b == 0 && c == 0) {
cout << -1;
return 0;
}
i... |
#include <bits/stdc++.h>
using namespace std;
double sqrtt(double x) {
if (x < 0)
return -sqrt(-x);
else
return sqrt(x);
}
int main() {
double a, b, c;
double x1, x2;
while (cin >> a >> b >> c) {
if (a == 0 && b == 0) {
if (c == 0)
printf("-1\n");
else
printf("0\n");
... |
#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
int main() {
istream &fin = cin;
ostream &fout = cout;
FILE *fpin = stdin;
FILE *fpout = stdout;
int A, B, C;
fin >> A >> B >> C;
if (A == 0 && B == 0 && C == 0) {
fout << -1 << endl;
return 0;
}
if (A == 0) {
if... |
#include <bits/stdc++.h>
using namespace std;
double A, B, C, d;
void Stampa(double x) { cout << fixed << setprecision(7) << x << endl; }
double Delta() { return pow(B, 2) - 4 * A * C; }
int main() {
ios::sync_with_stdio(false);
cin >> A >> B >> C;
if (A == 0) {
if (B == 0 && C == 0) {
cout << "-1\n";
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
long long A, B, C;
cin >> A >> B >> C;
if (A == 0) {
if (B == 0) {
cout << (C == 0 ? -1 : 0) << '\n';
} else {
cout << 1 << '\n';
cout << fixed << setprecision(10) << -1. * C / B ... |
#include <bits/stdc++.h>
int main() {
double a, b, c;
int i, j, k, m, n;
scanf("%lf%lf%lf", &a, &b, &c);
if (a == 0) {
if (b == 0) {
if (c == 0)
printf("-1\n");
else
printf("0\n");
} else
printf("1\n%0.10f\n", -c / b);
} else {
if (b * b - 4 * a * c < 0)
pri... |
#include <bits/stdc++.h>
using namespace std;
long long a, b, c;
int main() {
scanf("%lld%lld%lld", &a, &b, &c);
if (a == 0 && b == 0 && c == 0)
printf("-1\n");
else if (a == 0 && b == 0 && c != 0)
printf("0\n");
else if (a == 0 && b != 0)
printf("1\n%.10lf\n", -(double)(c) / b);
else {
int nu... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double i, a, b, c;
double ans, d, r1, r2;
cin >> a >> b >> c;
d = (b * b - 4 * a * c);
if (a == 0 && (b == 0 && c == 0)) {
cout << "-1";
} else if (a == 0 && b != 0) {
r1 = -c / b;
printf("1\n%.6f", r1);
} else if (a == 0 && b == 0) {
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c, dt;
cin >> a >> b >> c;
if (a == 0) {
if (b == 0 && c == 0)
cout << -1;
else if (b == 0 && c != 0)
cout << 0;
else if (b != 0 && c != 0) {
cout << 1 << "\n";
printf("%.8lf", -c / b);
} else {
c... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a, s, d;
cin >> a >> s >> d;
long long ans = s * s - 4 * a * d;
if (!a) {
double aa = -d;
aa /= s;
if (!s && d)
cout << 0;
else if (isinf(aa) || (!s && !d))
cout << -1;
else
cout << 1 << endl << setprecisi... |
#include <bits/stdc++.h>
using namespace std;
const long long MODN = 1000000007;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
double a, b, c;
cin >> a >> b >> c;
cout << fixed << setprecision(5);
if (a == 0) {
if (b == 0) {
if (c == 0)
cout << -1 << endl;
else
cout <... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, c, d;
cout.precision(10);
cin >> a >> b >> c;
if (a == 0) {
if (b == 0) {
if (c == 0)
cout << -1;
else
cout << 0;
} else {
long double cc = -c + 0.0;
cout << 1 << endl << cc / b;
}
} ... |
#include <bits/stdc++.h>
const double eps = 1e-8;
const double pi = 3.1415926535897932;
using namespace std;
ifstream in("input.txt", ifstream::in);
ofstream out("output.txt", ofstream::out);
int main() {
double ans[2];
long long A, B, C;
cin >> A >> B >> C;
if (A == 0) {
if (B == 0) {
if (C == 0)
... |
#include <bits/stdc++.h>
using namespace std;
void PTBac1(long long a, long long b) {
if (a == 0) {
if (b == 0) {
cout << "-1";
} else {
cout << "0";
}
} else {
cout << "1\n";
cout << fixed << setprecision(5) << 1.0 * -b / a;
}
}
void PTBac2(long long a, long long b, long long c) {... |
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.sync_with_stdio(false);
cin.tie(0);
long double a, b, c;
cin >> a >> b >> c;
if (a == 0 and b == 0 and c == 0)
cout << -1;
else if ((a == 0 and b == 0) or b * b - 4 * a * c < 0)
cout << 0;
else if (a == 0)
cout << fixed << setpreci... |
#include <bits/stdc++.h>
using namespace std;
template <typename T>
typename std::set<T>::const_iterator GetNearestTo(const std::set<T>& data,
const T& t) {
auto upper = data.lower_bound(t);
if (upper == data.begin() || (*upper) == t) return upper;
auto lower = up... |
#include <bits/stdc++.h>
int main() {
double a, b, c, s;
scanf("%lf %lf %lf", &a, &b, &c);
if (a == 0 && b == 0 && c == 0) {
printf("-1");
} else if (a == 0 && b != 0) {
printf("1\n%lf", (-c) / b);
} else if (a == 0 && b == 0 && c != 0) {
printf("%lf", b);
} else {
s = (b * b) - 4 * a * c;
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double A, B, C;
cin >> A >> B >> C;
if (A == 0 && B == 0 && C == 0) {
cout << "-1";
return 0;
}
if (A == 0 && B == 0 && C != 0) {
cout << "0";
return 0;
}
if (A == 0) {
double z = (-C) / B;
printf("1\n%.10lf", z);
retur... |
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
double a, b, c;
int main() {
cin >> a >> b >> c;
double s = b * b - 4 * a * c;
if (a == b && b == c && a == 0) return puts("-1"), 0;
if (a == 0 && b == 0) return puts("0"), 0;
if (a == 0) {
cout << 1 << endl;
printf("%.6lf\n", (-c) ... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int tc;
double a, b, c;
cin >> a >> b >> c;
double D = b * b - 4 * a * c;
int n;
if (D < 0) {
printf("0\n");
} else if (a == 0 && b == 0 && c == 0)
cout << "-1" << endl;
else if (a == 0 && b == 0)
cout << "0" << endl;
else if (a ==... |
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MOD = 1e6 + 10;
int main() {
double a, b, c;
while (~scanf("%lf%lf%lf", &a, &b, &c)) {
if (a == b && b == c && c == 0) {
printf("-1\n");
continue;
}
double x = b * b - a * 4 * c;
if (((a == 0 && b == 0) &... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c;
double x, y, d, p;
cin >> a >> b >> c;
d = b * b;
p = 4 * a * c;
d = d - p;
if (a == 0 && b == 0 && c == 0)
cout << "-1" << endl;
else if (a == 0 && b == 0)
cout << "0" << endl;
else if (a == 0) {
x = c * -1;
x ... |
#include <bits/stdc++.h>
using namespace std;
vector<double> v;
long long n, m, i, j, t, a, b, c, k;
int main() {
ios_base::sync_with_stdio(0);
cin >> a >> b >> c;
if (a == 0 && b == 0 && c == 0) {
cout << -1 << endl;
return 0;
} else if (a == 0 && b == 0) {
cout << 0 << endl;
return 0;
} else... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c;
while (~scanf("%lf%lf%lf", &a, &b, &c)) {
if (a == b && b == c && c == 0) {
printf("-1\n");
continue;
}
double x = b * b - a * 4 * c;
if (((a == 0 && b == 0) && c != 0) || x < 0) {
printf("0\n");
conti... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c;
cin >> a >> b >> c;
double d = pow(b, 2.0) - 4.0 * a * c;
if (d < 0 || a == 0 && b == 0 && c != 0) {
cout << 0 << "\n";
return 0;
} else if (a == 0 && b == 0 && c == 0) {
cout << -1 << "\n";
return 0;
} else if (a == ... |
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long INFLL = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long a, b, c;
cin >> a >> b >> c;
if (a == 0) {
if (b == 0 and c == 0) {
cout << -1 << en... |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cout << fixed << setprecision(10);
double a, b, c;
cin >> a >> b >> c;
if (a == 0 && b == 0 && c == 0)
cout << "-1";
else if (a == 0 && b == 0)
cout << "0";
else if (a == 0) {
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c;
cin >> a >> b >> c;
double d = b * b - 4 * a * c;
if (a == 0 && b == 0 && c == 0) {
cout << "-1\n";
return 0;
}
if (a == 0 && b == 0) {
cout << "0\n";
return 0;
}
if (a == 0) {
cout << "1\n";
printf("%.5lf... |
#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
double a, b, c;
cin >> a >> b >> c;
double d = b * b - 4 * a * c;
if (a == b && b == c && c == 0) {
cout << -1;
return 0;
}
if (a == b && b == 0) {
cout << 0;
return 0;
}
cout << fixed << setprecision(20);
if (a == 0)... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c;
scanf("%lf %lf %lf", &a, &b, &c);
if (a == 0) {
if (b == 0) {
if (c == 0)
printf("-1\n");
else
printf("0\n");
} else {
printf("1\n");
printf("%.6lf\n", -c / b);
}
} else {
double tt... |
#include <bits/stdc++.h>
using namespace std;
double A, B, C;
void Output(int n, double x = 0, double y = 0) {
printf("%d\n", n);
if (n >= 2 && x > y) swap(x, y);
if (n >= 1) printf("%.6f\n", x);
if (n >= 2) printf("%.6f\n", y);
}
int main(void) {
scanf("%lf%lf%lf", &A, &B, &C);
if (fabs(A) == 0) {
if (... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, c;
cin >> a >> b >> c;
long long det = b * b - 4 * a * c;
if (a == 0 && b == 0 && c == 0) {
cout << -1;
return 0;
}
if (a == 0 && b == 0 && c != 0) {
cout << 0;
return 0;
}
if (a == 0 && b != 0) {
cout << 1 <<... |
#include <bits/stdc++.h>
using namespace std;
double r1, r2, a, b, c, delta;
int main() {
cin >> a >> b >> c;
cout << fixed << setprecision(5);
if (a == b && b == c && c == 0) {
cout << -1;
return 0;
}
if (a != 0) {
delta = b * b - 4 * a * c;
if (delta == 0) {
cout << 1 << endl << ((-1) ... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, c;
cin >> a >> b >> c;
long long d = b * b - 4 * a * c;
if (a != 0) {
double x = a, y = b;
if (d < 0) cout << 0;
if (d == 0) {
cout << 1 << endl;
printf("%lf", -y / (2 * x));
}
if (d > 0) {
cout << 2... |
#include <bits/stdc++.h>
using namespace std;
double a, b, c, d;
int main() {
cin >> a >> b >> c;
if (a == b && a == c && a == 0) {
cout << -1;
return 0;
}
if (a == 0 && b == 0) {
cout << 0;
return 0;
}
if (a == 0) {
cout << 1 << endl;
cout << fixed;
cout << setprecision(9) << -c... |
#include <bits/stdc++.h>
using namespace std;
const long long MAX = LLONG_MAX, mod = 1000000007, MODA = 1e9 - 1;
const long long MIN = LLONG_MIN;
const long double PI = 3.1415926535;
const long long N = 100009;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long double a, b, c;
cin >> a >> b >> c... |
#include <bits/stdc++.h>
using namespace std;
int main() {
set<double> s;
set<double>::iterator it;
double a, b, c;
cin >> a >> b >> c;
double ans1, ans2;
if (a == 0 && b == 0 && c == 0)
cout << -1 << endl;
else if (a == 0 && b != 0) {
ans2 = -(c / b);
s.insert(ans2);
cout << s.size() << e... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, c;
cin >> a >> b >> c;
if (a == 0 && b != 0) {
cout << 1 << endl;
cout << fixed << setprecision(5) << -1.0 * c / b << endl;
} else if (a != 0 && b == 0) {
double resp = c * 1.0 / a;
if (resp < 0) {
cout << 2 << endl... |
#include <bits/stdc++.h>
using namespace std;
class Quadratic_root {
long long a, b, c;
public:
Quadratic_root(long a, long b, long c) : a(a), b(b), c(c) {}
void Calculate_roots() {
if ((b * b - 4 * a * c) < 0)
cout << 0 << endl;
else if (!a && !b && !c)
cout << -1 << endl;
else if (!a &... |
#include <bits/stdc++.h>
using namespace std;
double a, b, c;
int main() {
cin >> a >> b >> c;
double k = b * b;
double l = 4 * a * c;
if (a == 0) {
if (b == 0 && c == 0) {
cout << -1 << endl;
return 0;
}
if (b == 0 && c != 0) {
cout << 0 << endl;
return 0;
}
if (c ==... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double A, B, C;
const double EPSILON = 1e-6;
cin >> A >> B >> C;
if (fabs(A) < EPSILON) {
if (fabs(B) < EPSILON) {
if (fabs(C) < EPSILON)
cout << -1 << endl;
else
cout << 0 << endl;
} else {
cout << 1 << endl;
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c, x = 4, m = 0, a1, a2, n = 2, ans;
cin >> a >> b >> c;
ans = b * b - x * a * c;
if (a == m && b == m && c == m) {
cout << -1;
return 0;
}
if (a == m && b == m) {
cout << 0;
return 0;
}
if (a == m) {
cout << 1 <... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long double a, b, c;
cin >> a >> b >> c;
if (a == 0 && b == 0 && c == 0) {
cout << "-1" << endl;
return 0;
} else {
if (a == 0 && b == 0 && c != 0) {
cout << "0" << endl;
return 0;
} else {
if (a == 0 && b != 0) {
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, c;
cin >> a >> b >> c;
if (a != 0 && b != 0 && c != 0) {
long long d = b * b - 4 * a * c;
if (d < 0) {
cout << 0;
return 0;
}
long double r = sqrt(d), one = 1.0 * (-b - r) / (2 * a),
two = 1.0 * ... |
#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
int main() {
int a, b, c;
double delta;
double A, B, C;
long long aa, bb, cc;
while (scanf("%d %d %d", &a, &b, &c) != EOF) {
if (a == 0 && b == 0 && c == 0) {
printf("-1\n");
continue;
}
if (a == 0 && b == 0) {
... |
#include <bits/stdc++.h>
using namespace std;
vector<double> roots;
int main() {
double a, b, c;
scanf("%lf%lf%lf", &a, &b, &c);
if (a == 0 && b == 0 && c == 0) {
printf("-1\n");
return 0;
}
if (a == 0 && b == 0 && c != 0) {
printf("0\n");
return 0;
}
if (a == 0) {
printf("1\n");
p... |
#include <bits/stdc++.h>
const int N = 200010;
const int inf = 0x3f3f3f3f;
using namespace std;
string str;
long long a, b, c;
int main() {
cin >> a >> b >> c;
if (a == 0) {
if (c == 0) {
if (b == 0) return puts("-1"), 0;
printf("1\n0.000000000000\n");
return 0;
} else {
if (b == 0) ... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long double a, b, c, delta, x1, x2;
cin >> a >> b >> c;
if (a == 0 && b == 0 && c == 0) {
cout << -1;
return 0;
}
if (a == 0 && b == 0 && c != 0) {
cout << 0;
return 0;
}
if (a == 0 && b != 0) {
cout << "1\n" << fixed << setpre... |
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
const long long INT = 1e9;
const long long LONG = 1e18;
const long long mod = 1e9 + 7;
int main() {
double a, b, c;
cin >> a >> b >> c;
double d = b * b - 4 * a * c;
if (a == 0) {
if (b == 0) {
if (c == 0)
cout << -1;
else
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c;
scanf("%lf%lf%lf", &a, &b, &c);
if (a != 0) {
double d = b * b - 4 * a * c;
if (d > 0) {
double x1 = (-b - sqrt(d)) / (2 * a), x2 = (-b + sqrt(d)) / (2 * a);
if (x1 > x2) swap(x1, x2);
printf("2\n%.9f\n%.9f\n", x1... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double A, B, C;
cin >> A >> B >> C;
double a, b, d;
if (A == 0 && B == 0 && C == 0)
cout << -1;
else if (A > 0 || A < 0) {
if (B * B > 4 * A * C) {
d = B * B - (4 * A * C);
a = (-B + sqrt(d)) / (2 * A);
b = (-B - sqrt(d)) / (... |
#include <bits/stdc++.h>
int nextInt() {
int x;
scanf("%d", &x);
return x;
}
double nextDouble() {
double x;
scanf("%lf", &x);
return x;
}
long long nextLong() {
long long x;
scanf("%I64d", &x);
return x;
}
char nextChar() {
char x;
scanf("%c", &x);
return x;
}
void newLine() { printf("\n"); }
l... |
#include <bits/stdc++.h>
using namespace std;
int main(void) {
long double a, b, c, p, q, r;
cin >> a >> b >> c;
p = b * b - 4 * a * c;
if (a == 0 && b == 0 && c == 0)
cout << -1 << endl;
else if (a == 0 && b == 0 && c != 0)
cout << 0 << endl;
else if (p < 0)
cout << 0 << endl;
else if (a == 0... |
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long tt = 1;
while (tt--) {
long long a, b, c;
cin >> a >> b >> c;
if (a == 0 && b == 0 && c == 0) {
cout << -1 << endl;
} else if (a == 0 && b == 0) {
... |
#include <bits/stdc++.h>
using namespace std;
const bool online_judge = true;
const long long inf = 1LL << 60;
long long toInt(string s) {
long long res;
stringstream ss;
ss << s;
ss >> res;
return res;
}
string toString(long long n) {
stringstream ss;
ss << n;
return ss.str();
}
double EPS = 1e-9;
void... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long A, B, C;
cin >> A >> B >> C;
if (A == 0) {
if (B == 0) {
if (C == 0) {
cout << -1 << endl;
} else {
cout << 0 << endl;
}
} else {
double x = -1.0 * C / B;
cout << 1 << endl;
cout << fix... |
#include <bits/stdc++.h>
using namespace std;
double a, b, c, x, x1, x2, d;
int main() {
cin >> a >> b >> c;
d = b * b - 4 * a * c;
if (a == 0 && b == 0 && c != 0) {
cout << 0 << endl;
return 0;
}
if (a == 0 && b == 0 && c == 0) {
cout << -1 << endl;
return 0;
}
if (a == 0 && b != 0) {
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
double a, b, c, d, e, f;
cin >> a >> b >> c;
d = pow(b, 2) - (4 * a * c);
if (d < 0) {
cout << 0;
} else if (a == 0 and b == 0 and c == 0) {
cout << -1 << endl;
} else if (a == 0 and b == ... |
#include <bits/stdc++.h>
#pragma GCC target("sse4,avx")
void run(std::istream& in, std::ostream& out) {
int A, B, C;
in >> A >> B >> C;
out.precision(20);
if (A == 0) {
if (B == 0) {
if (C == 0) {
out << -1 << std::endl;
return;
}
out << 0 << std::endl;
return;
}
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c;
double x1, x2;
cin >> a >> b >> c;
if (a == 0 && b == 0) {
if (c == 0)
printf("-1\n");
else
printf("0\n");
} else if (a == 0 && c == 0) {
printf("1\n0\n");
} else if (b == 0 && c == 0) {
printf("1\n0\n");
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c;
scanf("%lf %lf %lf", &a, &b, &c);
if (a != 0 && b != 0 && c != 0) {
if (((b * b) - (4 * a * c)) == 0) {
printf("1\n");
printf("%lf", -b / (2 * a));
} else if (((b * b) - (4 * a * c)) > 0) {
printf("2\n");
if... |
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const int INF = 2147483647;
const long long LINF = 9223372036854775807;
const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1};
double a, b, c;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> a >> b >> c;
if (a == 0) {
if (b !... |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long double a, b, c;
cin >> a >> b >> c;
if (a == 0 && b != 0) {
cout << 1 << endl;
long double ans = (long double)(-c / b);
cout << fixed << setprecision(10) << ans << endl;
return 0... |
#include <bits/stdc++.h>
int main() {
double a, b, c;
scanf("%lf%lf%lf", &a, &b, &c);
if (a == 0 && b == 0 && c == 0) {
printf("-1");
return 0;
} else if (a == 0 && b == 0) {
printf("0");
return 0;
} else if (b == 0 && c == 0) {
printf("1\n%lf", 0);
return 0;
} else if (a == 0 && c =... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c;
cin >> a >> b >> c;
set<double> s;
double d = b * b - 4 * a * c;
if (d < 0) {
cout << "0" << endl;
} else if (a == 0 && b == 0 && c == 0) {
cout << "-1" << endl;
} else {
double a1, a2;
if (a != 0) {
a1 = (-b ... |
#include <bits/stdc++.h>
using namespace std;
double min(double a, double b) { return a < b ? a : b; }
double max(double a, double b) { return a > b ? a : b; }
int main() {
double a, b, c, x1, x2, dlta;
int num;
while (cin >> a >> b >> c) {
if (a == 0 && b == 0 && c == 0) {
cout << "-1" << endl;
c... |
#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d;
int main() {
scanf("%lld%lld%lld", &a, &b, &c);
if (a) {
if (a < 0) a = -a, b = -b, c = -c;
d = b * b - 4 * a * c;
if (d > 0)
printf("2\n%.10lf\n%.10lf\n", (-b - sqrt((double)d)) / (2 * a),
(-b + sqrt((double)d)) / (2... |
#include <bits/stdc++.h>
int main() {
double a, b, c, p, root1, root2;
scanf(" %lf%lf%lf", &a, &b, &c);
if (a != 0) {
p = b * b - 4 * a * c;
if (p < 0)
printf("0\n");
else {
if (p == 0) {
printf("1\n");
root1 = -b / (2 * a);
printf("%.6lf", root1);
} else {
... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
template <typename T>
using lim = numeric_limits<T>;
template <typename T>
istream& operator>>(istream& is, vector<T>& a) {
for (T& x : a) {
is >> x;
}
return is;
}
int main() {
ios_base::sync_with_stdio(false);
ci... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c, d;
while (cin >> a >> b >> c) {
d = b * b - 4 * a * c;
if (!a && !b && !c) {
cout << -1 << endl;
continue;
}
if ((!a && !b && c) || d < 0) {
cout << 0 << endl;
continue;
}
if (!a && b) {
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c, d;
cin >> a >> b >> c;
d = b * b - 4 * a * c;
if (a == 0 && b == 0 && c == 0)
printf("-1\n");
else if (a == 0 && b == 0 && c != 0)
printf("0\n");
else if (a == 0)
printf("1\n%f\n", -(c / b));
else if (d < 0)
printf(... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c;
cin >> a >> b >> c;
double d = b * b - a * c * 4;
double x1 = (-b + sqrt(d)) / (2 * a);
double x2 = (-b - sqrt(d)) / (2 * a);
if (d < 0) {
cout << 0;
} else if (a == 0 && b == 0 && c != 0) {
cout << 0;
} else if (a == 0 &... |
#include <bits/stdc++.h>
using namespace std;
using uint = uint32_t;
using ull = uint64_t;
using ld = long double;
using ll = int64_t;
template <typename T>
int cmp(const T &a, const T &b) {
return ((a + 1e-9 < b) ? -1 : ((b + 1e-9 < a) ? 1 : 0));
}
class Task {
private:
ld A, B, C;
void degree2() {
ld sq = ... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int a, b, c;
double x, s, x1, x2;
long long int l;
while (~scanf("%lld%lld%lld", &a, &b, &c)) {
if (a == 0 && b == 0 && c == 0)
printf("-1\n");
else if (a == 0 && b == 0)
printf("0\n");
else if (b == 0 && c == 0)
... |
#include <bits/stdc++.h>
using namespace std;
double a, b, c;
double min(double a, double b) {
if (a > b) return b;
return a;
}
double max(double a, double b) {
if (a < b) return b;
return a;
}
int main() {
double t, x1, x2;
while (scanf("%lf %lf %lf", &a, &b, &c) != EOF) {
if (a == 0 && b == 0 && c == ... |
#include <bits/stdc++.h>
using namespace std;
const long long int maxn = 200005;
vector<long long int> adj[maxn];
long long int a[maxn], jvb[maxn];
int main() {
ios_base::sync_with_stdio(false);
double a, b, c, delta = 0;
cin >> a >> b >> c;
double rt1, rt2;
cout << fixed << setprecision(12);
if (a == 0 && ... |
#include <bits/stdc++.h>
using namespace std;
long long int r, j, l, x, y, m, c, n, s, f, q, i, z, p, k, d, t, u, e, g, w;
string s1, s2, s3, s4;
int main() {
cin >> x >> y >> z;
if (x == 0) {
if (y == 0) {
if (z == 0)
cout << -1;
else
cout << 0;
} else {
printf("1\n");
... |
#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d;
double ans, ans1, ans2;
int main() {
scanf("%I64d %I64d %I64d", &a, &b, &c);
if (a == 0) {
if (b == 0) {
if (c == 0) {
puts("-1");
} else {
puts("0");
}
} else {
puts("1");
ans = (double)(-c) / ... |
#include <bits/stdc++.h>
long long A, B, C, D;
int main() {
std ::cin >> A >> B >> C;
D = B * B - 4 * A * C;
if (A == 0 && B == 0 && C == 0)
printf("-1\n");
else if (A == 0 && B == 0 && C != 0)
printf("0\n");
else if (A == 0)
printf("1\n%lf\n", -(double)C / B);
else if (D < 0)
printf("0\n");... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.