讨论 / 为什么错了啊~~~
niu 2009-01-31 04:13:00
点我顶贴 收藏 删除
程序:

var a:array[1..50]of longint;

p,s,n,i,x:longint;

begin

fillchar(a,sizeof(a),-1);

readln(p,s,n);

for i:=1 to s do readln(a[i]);

if n<=a[s] then x:=-1;

if x=0 then begin

if(a[1]<=n) then x:=1;

if x=0 then for i:=1 to s do if(a[i]=n)then break;

if i<>s then x:=i;

if x=0 then for i:=1 to s do if(a[i]>n)and(a[i+1]<n)then x:=i+1;

end;

writeln(x);

end.

结果第5个点过不去~~~

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

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

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

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

测试结果5: 测试结果错误.错误结果为:-1

正确结果应为:11

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

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

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

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

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

#1 niu@2009-01-31 03:29:00
回复 删除
怎么没人回答?

给下数据或给下建议都行~~~

#2 niu@2009-01-31 04:13:00
回复 删除
已经通过了

没有考虑分数个数<排行榜的情况。

55555~

查看更多回复
提交回复