|
|
back to boardWA on 4 test HELR PLZ!! Posted by watson 10 Aug 2008 19:04 this is my code what's wrong program Project1; {$APPTYPE CONSOLE} uses SysUtils; var n,i,r,l,m,sch:longint; a,b:array[1..10000001]of longint; begin reset(input,'input.txt'); rewrite(output,'output.txt'); sch:=0; read(n); r:=n; l:=1; for i:=1 to n do read(a[i]); read(m); for i:=1 to m do read(b[i]); for i:=1 to m do begin while r-l>1 do begin m:=(l+r div 2); if a[m]<b[i] then l:=m+1 else r:=m end; if (a[l]=b[i])or(a[r]=b[i])or(a[l+1]=b[i]) then inc(sch); end; write(sch); end. Re: WA on 4 test HELR PLZ!! yasha it's because you have bad arms!!!! it is your main problem!!!! |
|
|