为什么会RE?

P2870 [USACO07DEC] Best Cow Line G

为什么会TLE
by stone2000 @ 2016-10-22 14:57:57


上面的程序无视掉……
by 吴国铨 @ 2016-10-22 16:25:55


为什么会WA? ```cpp program ezx; var a:array[0..30010] of char; m,n,i,j,k:longint; num1,num2:longint; s:array[0..30010] of char; pd:array[0..30010] of boolean; begin fillchar(pd,sizeof(pd),true); //assign(input,'bclgood.in'); //assign(output,'bclgood.out'); //reset(input); //rewrite(output); readln(n); for i:=1 to n do readln(a[i]); j:=1; k:=n; i:=0; while (j<k)and((pd[j])or(pd[k])) do begin if (ord(a[j])<ord(a[k]))and(pd[j]) then begin inc(i); s[i]:=a[j]; pd[j]:=false; inc(j); end else if (ord(a[j])>ord(a[k]))and(pd[k]) then begin inc(i); s[i]:=a[k]; pd[k]:=false; dec(k); end else if (ord(a[j])=ord(a[k]))and(pd[j])and(pd[k]) then begin num1:=j; num2:=k; while (a[num1]=a[num2])and(num1<num2) do begin inc(num1); dec(num2); end; {repeat inc(num1); dec(num2); until (a[num1]<>a[num2])or(num1=num2)or(num1>num2);} if ord(a[num1])<ord(a[num2]) then begin inc(i); s[i]:=a[j]; pd[j]:=false; inc(j); end else if ord(a[num1])>ord(a[num2]) then begin inc(i); s[i]:=a[k]; pd[k]:=false; dec(K); end else if num1=num2 then begin inc(i); s[i]:=a[k]; pd[k]:=false; dec(K); inc(i); s[i]:=a[j]; pd[j]:=false; inc(j); end else if num1>num2 then begin inc(i); s[i]:=a[k]; pd[k]:=false; dec(K); end; end; end; j:=0; num1:=i div 80; num2:=i mod 80; for i:=1 to num1 do begin for m:=1 to 80 do begin inc(j); write(s[j]); end; writeln; end; for k:=1 to num2 do write(s[80*num1+k]); for i:=1 to n do if pd[i] then write(a[i]); //close(input); //close(output); end. ```
by 吴国铨 @ 2016-10-22 16:26:26


你不参加NOIP初赛?
by rushcheyo @ 2016-10-22 17:00:06


我今年不参加noip
by 吴国铨 @ 2016-10-23 17:34:41


不是,就是,写完提前交卷了
by 吴国铨 @ 2016-10-23 18:15:02


|