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