QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#536935#3721. Simple AlgebrasudokuAC ✓305ms3680kbC++17631b2024-08-29 18:09:502024-08-29 18:09:50

Judging History

This is the latest submission verdict.

  • [2024-08-29 18:09:50]
  • Judged
  • Verdict: AC
  • Time: 305ms
  • Memory: 3680kb
  • [2024-08-29 18:09:50]
  • Submitted

answer

#include <iostream>
#include <vector>
#include <string>
#include <string.h>
#include <queue>
#include <bitset>
#include<numeric>
#include <unordered_map>
#include <iomanip>
#include <map>
#include <stack>
#include <set>
#include <algorithm>
#include <math.h>
using namespace std;
int main()
{
    int a,b,c;
    while(~scanf("%d%d%d",&a,&b,&c))
    {
        int ans = 1000000000;
            for(int x=-100;x<=100;x++)
                for(int y=-100;y<=100;y++)
                    ans = min(ans, a*x*x+b*x*y+c*y*y);
            if(ans<0) puts("No");
            else puts("Yes");
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 305ms
memory: 3680kb

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