为什么本地运行通过而评测却RE了

P3958 [NOIP2017 提高组] 奶酪

``` freopen("2.in","r",stdin); freopen("2.out","w",stdout); ``` 什么鬼?
by _wkjzyc @ 2018-11-08 13:24:36


@[曾熠辰](/space/show?uid=34372) 调试用的文件输入输出啊,交的时候没有这两句的
by zombie462 @ 2018-11-08 13:25:13


```pascal // luogu-judger-enable-o2 var test,t,ww,n,h,r,i,j,xx:longint; queue,w,x,y,z:array[0..2000] of int64; q:array[0..2000,0..2000] of longint; f:array[0..2000] of boolean; ff:boolean; function dist(i,j:int64):real; begin dist:=sqrt(sqr(x[i]-x[j])+sqr(y[i]-y[j])+sqr(z[i]-z[j])); end; begin readln(test); for test:=1 to test do begin fillchar(q,sizeof(q),0); fillchar(w,sizeof(w),0); fillchar(f,sizeof(f),false); t:=0;ww:=0; readln(n,h,r); for i:=1 to n do begin readln(x[i],y[i],z[i]); if (z[i]>=0) and (z[i]<=r) or (z[i]<=0) and (z[i]+r>=0) then begin f[i]:=true; inc(ww); queue[ww]:=i; end; end; for i:=1 to n do for j:=i+1 to n do if dist(i,j)<=r+r then begin inc(w[i]); q[i,w[i]]:=j; inc(w[j]); q[j,w[j]]:=i; end; while t<ww do begin inc(t); xx:=queue[t]; for i:=1 to w[xx] do begin j:=q[xx,i]; if f[j]=false then begin f[j]:=true; inc(ww); queue[ww]:=j; end; end; end; ff:=false; for i:=1 to n do if (f[i]=true) and (z[i]+r>=h) then begin ff:=true; break; end; if ff=false then writeln('No') else writeln('Yes'); end; end. ``` 先%巨佬 巨佬这是我的程序,我用宽搜做的
by Holy_Push @ 2018-11-08 13:25:14


边少了吧... 1000个点应该不只有3333条边吧
by ajil @ 2018-11-08 13:34:06


@[ajil](/space/show?uid=22911) ![](https://cdn.luogu.com.cn/upload/pic/42739.png) 还真过了,谢谢大佬 那为什么本地通过,说不通啊...
by zombie462 @ 2018-11-08 13:39:16


@[zombie462](/space/show?uid=107231) 说不定是linux内存检测更严格... WINDOWS说不定你越界还是能跑...
by ajil @ 2018-11-08 13:41:14


|