HUAWEI OD machine test real questions - judging whether a set of inequalities satisfy the constraints and output the maximum difference - 2023 OD unified test (B paper)

Title description : Given a set of inequalities, judge whether it is true and output the maximum difference of the inequalities (output the integer part of the floating-point number). Requirements: 1) The coefficient of the inequality is a double type, which is a two-dimensional array; 2) The variable of the inequality is int type, which is a one-dimensional array; 3) the target value of the inequality is double type, which is a one-dimensional array; 4) the inequality constraint is a string array, which can only be: ">",">=","<","< =","=", for example, inequality group:
a11*x1+a12*x2+a13*x3+a14*x4+a15*x5<=b1;
a21*x1+a22*x2+a23*x3+a24*x4 +a25*x5<=b2;

a31*x1+a32*x2+a33*x3+a34*x4+a35*x5<=b3;

Maximum difference=max{ (a11*x1+a12*x2+a13*x3+a14*x4+a15*x5-b1), (a21*x1+a22*x2+a23*x3+a24*x4+a25*x5- b2), (a31*x1+a32*x2+a33*x3+a34*x4+a35*x5-b3) }, the type is integer (the integer part of the output floating point number)

Enter a description:

1) Inequality group coefficient (double type):

a11,a12,a13,a14,a15 

a21,a22,a23,a24,a25 
a31,a32,a33,a34,a35
2)

Guess you like

Origin blog.csdn.net/2301_76848549/article/details/131994730