63 条题解
-
-1
飓风音速 LV 10 @ 2009-07-20 14:01:12
数据有严重问题,害的我交了好几次
-
-12009-06-29 17:33:35@
交了N次终于过了……
-
-12009-06-18 17:35:46@
AC标程,仅供参考。
谢谢。编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0msprogram P1480;
var
s,r,y :ansistring;
i,j,k,l,t,p :longint;
ans,next :array[0..65536]of longint;
begin
readln(s);
fillchar(ans,sizeof(ans),127);
fillchar(next,sizeof(next),0);
ans[0]:=0; l:=length(s);
for i:=1 to l do
for j:=trunc(sqrt(l-i+1)) downto 1 do
begin
t:=ans+1;
if ans>t then
begin
ans:=t;
next:=j;
end;
end;
i:=l; r:=''; k:=0;
while next[i]0 do
begin
j:=next[i]; i:=i-j*j;
y:=copy(s,k+1,j*j); k:=k+j*j;
for l:=1 to j do
for p:=1 to j do r:=r+y[(p-1)*j+l];
end;
writeln(r);
end.