讨论 / 这什么情况?
8da2k 2010-05-29 02:05:00
点我顶贴 收藏 删除
状态: Unaccepted

测评机: Xeond[6]

得分: 80分

提交日期: 2010-5-29 16:59:00

有效耗时: 500毫秒

测试结果1: 通过本测试点|有效耗时172ms

测试结果2: 通过本测试点|有效耗时47ms

测试结果3: 测试结果错误.错误结果为:no

正确结果应为:yes

测试结果4: 通过本测试点|有效耗时47ms

测试结果5: 通过本测试点|有效耗时46ms

测试结果6: 通过本测试点|有效耗时47ms

测试结果7: 运行错误|无效浮点操作

测试结果8: 通过本测试点|有效耗时47ms

测试结果9: 通过本测试点|有效耗时47ms

测试结果10: 通过本测试点|有效耗时47ms

原程序:

program p1134;

var

a:array[1..4]of longint;

i,j:longint;

s,s1:string;

pd:boolean;

function p(b,c,d,e:longint):boolean;

begin

p:=false;

if abs((b+c+d+e)-24)<0.0000000001 then p:=true;

if abs((b+c+d-e)-24)<0.0000000001 then p:=true;

if abs((b+c-d-e)-24)<0.0000000001 then p:=true;

if abs((b-c-d-e)-24)<0.0000000001 then p:=true;

if abs((-b-c-d-e)-24)<0.0000000001 then p:=true;

if abs((b*c+d+e)-24)<0.0000000001 then p:=true;

if abs((b*c*d+e)-24)<0.0000000001 then p:=true;

if abs((b*c*d*e)-24)<0.0000000001 then p:=true;

if abs((b*c+d*e)-24)<0.0000000001 then p:=true;

if abs((b*c-d-e)-24)<0.0000000001 then p:=true;

if abs((b*c-d+e)-24)<0.0000000001 then p:=true;

if abs((b*c*d-e)-24)<0.0000000001 then p:=true;

if abs((b*c-d*e)-24)<0.0000000001 then p:=true;

if abs((b/c+d+e)-24)<0.0000000001 then p:=true;

if abs((b/c+d/e)-24)<0.0000000001 then p:=true;

if abs((b/c-d/e)-24)<0.0000000001 then p:=true;

if abs((b/c-d-e)-24)<0.0000000001 then p:=true;

if abs((b/c+d/e)-24)<0.0000000001 then p:=true;

if abs((b/c-d+e)-24)<0.0000000001 then p:=true;

if abs((b/c-d*e)-24)<0.0000000001 then p:=true;

if abs((b/c/d+e)-24)<0.0000000001 then p:=true;

if abs((b/c*d+e)-24)<0.0000000001 then p:=true;

if abs((b/c/d-e)-24)<0.0000000001 then p:=true;

if abs((b/c*d-e)-24)<0.0000000001 then p:=true;

if abs((b*c-d/e)-24)<0.0000000001 then p:=true;

if (d+e>0)and(abs(((b+c)/(d+e))-24)<0.0000000001) then p:=true;

if abs(((b+c)*(d+e))-24)<0.0000000001 then p:=true;

if abs(((b+c+d)/e)-24)<0.0000000001 then p:=true;

if abs(((b+c+d)*e)-24)<0.0000000001 then p:=true;

if (c+d+e>0)and(abs((b/(c+d+e))-24)<0.0000000001) then p:=true;

if abs((b*c*d/e)-24)<0.0000000001 then p:=true;

if abs((b*c/d/e)-24)<0.0000000001 then p:=true;

if abs((b/c/d/e)-24)<0.0000000001 then p:=true;

if (d+e>0)and(abs((b*c/(d+e))-24)<0.0000000001) then p:=true;

if (d-e>0)and(abs((b*c/(d-e))-24)<0.0000000001) then p:=true;

if abs((b*c*(d+e))-24)<0.0000000001 then p:=true;

if abs((b*c*(d-e))-24)<0.0000000001 then p:=true;

if (d-e>0)and(abs((b/c/(d-e))-24)<0.0000000001) then p:=true;

if (d+e>0)and(abs((b/c/(d+e))-24)<0.0000000001) then p:=true;

if abs(((d-e)/c*b)-24)<0.0000000001 then p:=true;

if abs(((d+e)/c*b)-24)<0.0000000001 then p:=true;

if (d-e>0)and(abs(((b-c)/(d-e))-24)<0.0000000001) then p:=true;

if (d+e>0)and(abs(((b-c)/(d+e))-24)<0.0000000001) then p:=true;

if (d-e>0)and(abs(((b-c)*(d-e))-24)<0.0000000001) then p:=true;

if (d-e>0)and(abs(((b+c)/(d-e))-24)<0.0000000001) then p:=true;

if abs(((b-c-d)*e)-24)<0.0000000001 then p:=true;

if abs(((b+c-d)*e)-24)<0.0000000001 then p:=true;

if abs(((-b-c-d)*e)-24)<0.0000000001 then p:=true;

if abs(((b+c-d)/e)-24)<0.0000000001 then p:=true;

if abs(((-b-c-d)/e)-24)<0.0000000001 then p:=true;

if abs(((b-c-d)/e)-24)<0.0000000001 then p:=true;

if (b-c-d>0)and(abs((e/(b-c-d))-24)<0.0000000001) then p:=true;

if (b-c+d>0)and(abs((e/(b-c+d))-24)<0.0000000001) then p:=true;

if (-b-c-d>0)and(abs((e/(-b-c-d))-24)<0.0000000001) then p:=true;

if abs((b-(c+d)/e)-24)<0.0000000001 then p:=true;

if abs((b-(c-d)/e)-24)<0.0000000001 then p:=true;

if abs((b+(c+d)/e)-24)<0.0000000001 then p:=true;

if abs((b+(c-d)/e)-24)<0.0000000001 then p:=true;

if (c+d>0)and(abs((b-e/(c+d))-24)<0.0000000001) then p:=true;

if (c-d>0)and(abs((b-e/(c-d))-24)<0.0000000001) then p:=true;

if (c+d>0)and(abs((b+e/(c+d))-24)<0.0000000001) then p:=true;

if (c-d>0)and(abs((b+e/(c-d))-24)<0.0000000001) then p:=true;

if abs((b-e*(c+d))-24)<0.0000000001 then p:=true;

if abs((b-e*(c-d))-24)<0.0000000001 then p:=true;

if abs((b+e*(c+d))-24)<0.0000000001 then p:=true;

if abs((b+e*(c-d))-24)<0.0000000001 then p:=true;

if abs((b-c*d*e)-24)<0.0000000001 then p:=true;

if abs((b-c/d*e)-24)<0.0000000001 then p:=true;

if abs((b-c*d/e)-24)<0.0000000001 then p:=true;

if abs((b-c/d/e)-24)<0.0000000001 then p:=true;

if (c+d/e>0)and(abs((b/(c+d/e))-24)<0.0000000001) then p:=true;

if (c-d/e>0)and(abs((b/(c-d/e))-24)<0.0000000001) then p:=true;

if (c-d*e>0)and(abs((b/(c-d*e))-24)<0.0000000001) then p:=true;

if (c+d*e>0)and(abs((b/(c+d*e))-24)<0.0000000001) then p:=true;

if abs((b*(c+d*e))-24)<0.0000000001 then p:=true;

if abs((b*(c-d*e))-24)<0.0000000001 then p:=true;

if abs((b*(c+d/e))-24)<0.0000000001 then p:=true;

if abs((b*(c-d/e))-24)<0.0000000001 then p:=true;

if abs(((c+d/e)/b)-24)<0.0000000001 then p:=true;

if abs(((c-d/e)/b)-24)<0.0000000001 then p:=true;

if abs(((c-d*e)/b)-24)<0.0000000001 then p:=true;

if abs(((c+d*e)/b)-24)<0.0000000001 then p:=true;

end;

begin

readln(s);

fillchar(a,sizeof(a),0);

for i:=1 to 3 do

begin

j:=pos(' ',s);

s1:=copy(s,1,j-1);

delete(s,1,j);

if s1='A' then a[i]:=1;

if s1='J' then a[i]:=11;

if s1='Q' then a[i]:=12;

if s1='K' then a[i]:=13;

if a[i]=0 then val(s1,a[i],j);

end;

if s='A' then a[4]:=1;

if s='J' then a[4]:=11;

if s='Q' then a[4]:=12;

if s='K' then a[4]:=13;

if a[4]=0 then val(s,a[4],j);

pd:=(p(a[1],a[2],a[3],a[4]))or(p(a[1],a[2],a[4],a[3]))or(p(a[1],a[3],a[2],a[4]))

or(p(a[1],a[3],a[4],a[2]))or(p(a[1],a[4],a[2],a[3]))or(p(a[1],a[4],a[3],a[2]))

or(p(a[2],a[1],a[3],a[4]))or(p(a[2],a[1],a[4],a[3]))or(p(a[2],a[3],a[1],a[4]))

or(p(a[2],a[3],a[4],a[1]))or(p(a[2],a[4],a[1],a[3]))or(p(a[2],a[4],a[3],a[1]))

or(p(a[3],a[1],a[2],a[4]))or(p(a[3],a[1],a[4],a[2]))or(p(a[3],a[2],a[1],a[4]))

or(p(a[3],a[2],a[4],a[1]))or(p(a[3],a[4],a[1],a[2]))or(p(a[3],a[4],a[2],a[1]))

or(p(a[4],a[1],a[2],a[3]))or(p(a[4],a[1],a[3],a[2]))or(p(a[4],a[2],a[1],a[3]))

or(p(a[4],a[2],a[3],a[1]))or(p(a[4],a[3],a[1],a[2]))or(p(a[4],a[3],a[2],a[1]));

if pd then writeln('yes')

else writeln('no');

end.

查看更多回复
提交回复