QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#374397#3721. Simple Algebra秦始皇派蒙恬还原神舟十二 (Jiancong Wen, Chu Jin, Zekai Zhang)AC ✓3ms3568kbC++17525b2024-04-02 14:01:162024-04-02 14:01:17

Judging History

This is the latest submission verdict.

  • [2024-04-02 14:01:17]
  • Judged
  • Verdict: AC
  • Time: 3ms
  • Memory: 3568kb
  • [2024-04-02 14:01:16]
  • Submitted

answer

#include<iostream>
#include<string.h>
#include<stdio.h>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<unordered_map>
#include<algorithm>
#define int long long
using namespace std;
signed main(){
	ios::sync_with_stdio(false);
	cin.tie();
	cout.tie();
	int a,b,c;
	while(cin>>a){
		cin>>b>>c;
		if(a==0){
			if(b==0 && c>=0) cout<<"Yes\n";
			else cout<<"No\n";
		}
        else if(a<0) cout<<"No\n";
		else{
			int oo=(b*b-4*a*c);
			if(oo<=0) cout<<"Yes\n";
			else cout<<"No\n";
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 3568kb

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