CF621D.Rat Kwesh and Cheese
提高+/省选-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Wet Shark asked Rat Kwesh to generate three positive real numbers x, y and z, from 0.1 to 200.0, inclusive. Wet Krash wants to impress Wet Shark, so all generated numbers will have exactly one digit after the decimal point.
Wet Shark knows Rat Kwesh will want a lot of cheese. So he will give the Rat an opportunity to earn a lot of cheese. He will hand the three numbers x, y and z to Rat Kwesh, and Rat Kwesh will pick one of the these twelve options:
- _a_1 = x__y__z;
- _a_2 = x__z__y;
- _a_3 = (x__y)z;
- _a_4 = (x__z)y;
- _a_5 = y__x__z;
- _a_6 = y__z__x;
- _a_7 = (y__x)z;
- _a_8 = (y__z)x;
- _a_9 = z__x__y;
- _a_10 = z__y__x;
- _a_11 = (z__x)y;
- _a_12 = (z__y)x.
Let m be the maximum of all the a__i, and c be the smallest index (from 1 to 12) such that a__c = m. Rat's goal is to find that c, and he asks you to help him. Rat Kwesh wants to see how much cheese he gets, so he you will have to print the expression corresponding to that a__c.
Wet Shark 要求 Rat Kwesh 生成三个正实数 x、y 和 z,取值范围为 0.1 到 200.0(含端点)。为了给 Wet Shark 留下深刻印象,Rat Kwesh 生成的所有数字均恰好保留一位小数。
Wet Shark 知道 Rat Kwesh 非常想要奶酪,因此他决定给 Rat Kwesh 一个赚取大量奶酪的机会。他将把三个数 x、y 和 z 交给 Rat Kwesh,而 Rat Kwesh 需要从以下十二种选项中选择其一:
- a1=xyz;
- a2=xzy;
- a3=(xy)z;
- a4=(xz)y;
- a5=yxz;
- a6=yzx;
- a7=(yx)z;
- a8=(yz)x;
- a9=zxy;
- a10=zyx;
- a11=(zx)y;
- a12=(zy)x.
令 m 为所有 ai 中的最大值,c 为满足 ac=m 的最小下标(即 c 是 1 到 12 中最小的满足条件的整数)。Rat Kwesh 的目标是找出该 c,他请你协助完成。由于 Rat Kwesh 想知道他能获得多少奶酪,你需要输出对应于 ac 的表达式。
输入格式
The only line of the input contains three space-separated real numbers x, y and z (0.1 ≤ x, y, z ≤ 200.0). Each of x, y and z is given with exactly one digit after the decimal point.
输入仅包含一行,其中有三个以空格分隔的实数 x、y 和 z(0.1≤x,y,z≤200.0)。每个数 x、y 和 z 均恰好保留一位小数。
输出格式
Find the maximum value of expression among x__y__z, x__z__y, (x__y)z, (x__z)y, y__x__z, y__z__x, (y__x)z, (y__z)x, z__x__y, z__y__x, (z__x)y, (z__y)x and print the corresponding expression. If there are many maximums, print the one that comes first in the list.
x__y__z should be outputted as xyz (without brackets), and (x__y)z should be outputted as (xy)z (quotes for clarity).
在表达式 x^y^z、x^z^y、(xy)z、(xz)y、y^x^z、y^z^x、(yx)z、(yz)x、z^x^y、z^y^x、(zx)y、(zy)x 中,找出最大值,并输出对应的表达式。若存在多个最大值,输出列表中位置最靠前的那个。
x^y^z 应输出为 x^y^z(不带括号),(xy)z 应输出为 (x^y)^z(引号仅作说明之用)。
输入输出样例
输入#1
1.1 3.4 2.5
输出#1
z^y^x
输入#2
2.0 2.0 2.0
输出#2
x^y^z
输入#3
1.9 1.8 1.7
输出#3
(x^y)^z
输入解题思路,AI测评打分。不知道怎么写?