2019牛客暑期多校训练营(第七场)-B Irreducible Polynomial(多项式因式分解)

题目链接:https://ac.nowcoder.com/acm/contest/887/B

题意:给定整系数多项数,判断实数域上是否可约。

思路:

AC代码:

#include<cstdio>
using namespace std;

typedef long long LL;
int T,n;
LL a[25];

int main(){
    scanf("%d",&T);
    while(T--){
        scanf("%d",&n);
        for(int i=n;i>=0;--i)
            scanf("%lld",&a[i]);
        if(n>2){
            printf("No
");
        }
        else if(n==2){
            if(a[1]*a[1]>=4*a[2]*a[0])
                printf("No
");
            else
                printf("Yes
");
        }
        else{
            printf("Yes
");
        }
    }
    return 0;
}
原文地址:https://www.cnblogs.com/FrankChen831X/p/11325646.html