QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#189276#3721. Simple AlgebraCidoai#AC ✓1ms1388kbC++20829b2023-09-27 08:01:462023-09-27 08:01:47

Judging History

This is the latest submission verdict.

  • [2023-09-27 08:01:47]
  • Judged
  • Verdict: AC
  • Time: 1ms
  • Memory: 1388kb
  • [2023-09-27 08:01:46]
  • Submitted

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