QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#374476 | #3721. Simple Algebra | NYOJ-2 | AC ✓ | 2ms | 3628kb | C++17 | 991b | 2024-04-02 14:33:41 | 2024-04-02 14:33:42 |
Judging History
answer
#include <bits/stdc++.h>
#define ll long long
#define inf 0x3f3f3f3f
#define pll pair<ll, ll>
using namespace std;
const int mod = 1e9 + 7;
const int N = 2e5 + 7;
ll n, m;
void Z()
{
int a, b ,c;
while (cin >> a)
{
cin >> b >> c;
bool flag = 0;
if (a < 0)
{
cout << "No" << "\n";
}
else if (a == 0)
{
if (b == 0 && c >= 0)
{
cout << "Yes" << "\n";
}
else
{
cout << "No" << "\n";
}
}
else if (a > 0)
{
if (b * b - 4 * a * c <= 0)
{
cout << "Yes" << "\n";
}
else
{
cout << "No" << "\n";
}
}
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
//cin >> t;
while (t--)
{
Z();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3628kb
input:
-10 -10 -10 -10 -10 -9 -10 -10 -8 -10 -10 -7 -10 -10 -6 -10 -10 -5 -10 -10 -4 -10 -10 -3 -10 -10 -2 -10 -10 -1 -10 -10 0 -10 -10 1 -10 -10 2 -10 -10 3 -10 -10 4 -10 -10 5 -10 -10 6 -10 -10 7 -10 -10 8 -10 -10 9 -10 -10 10 -10 -9 -10 -10 -9 -9 -10 -9 -8 -10 -9 -7 -10 -9 -6 -10 -9 -5 -10 -9 -4 -10 -9 ...
output:
No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No ...
result:
ok