QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#189276 | #3721. Simple Algebra | Cidoai# | AC ✓ | 1ms | 1388kb | C++20 | 829b | 2023-09-27 08:01:46 | 2023-09-27 08:01:47 |
Judging History
answer
#include<cstdio>
#include<cmath>
using namespace std;
typedef long long ll;
inline int read(){
int x=0;
int f=0,ch=0;
while(ch<48||ch>57) f=(ch=='-'),ch=getchar();
while(ch>47&&ch<58) x=(x<<3)+(x<<1)+(ch&15),ch=getchar();
return f?-x:x;
}
inline void write(int x,char end=' '){
if(x==0){
putchar('0');
putchar(end);
return;
}
if(x<0) putchar('-'),x=-x;
int ch[70]={0},cnt=0;
while(x){
ch[cnt++]=(int)(x%10);
x/=10;
}
while(cnt--) putchar(ch[cnt]+48);
putchar(end);
}
const double eps=1e-6;
int main(){
int a,b,c;
while(~scanf("%d%d%d",&a,&b,&c)){
if(b==0){
if(a>=0&&c>=0) puts("Yes");
else puts("No");
continue;
}
if(a<=0||c<=0){
puts("No");
continue;
}
if(b*b<=4*a*c){
puts("Yes");
}
else{
puts("No");
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 1388kb
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