|
增加一个条件,快了一点
------------ ---------- ---------- ----------- ---------- ---------- ----------------------------------------------------------------------
<anonymous> 15 38997 1 38997 38997
<anonymous> 18 21998 1 21998 21998
<anonymous> 25 6999 1 6999 6999
SD3B1 11 22225488 29695 999 23998 i:=instr(a,'0');
SD3B1 12 4801673 29695 0 17998 if (i=0) then
SD3B1 13 96993 1 96993 96993 dbms_output.put_line(a);
SD3B1 14 0 1 0 0 return;
SD3B1 16 4314706 29694 999 4999 e:=0;
SD3B1 17 30838902 29694 999 24998 r:=floor((i-1)/9)+1;
SD3B1 18 25320277 29694 999 23998 c:=mod(i-1,9)+1;
SD3B1 19 26936167 29694 999 21998 r0:=floor((i-1)/27)*3+1;
SD3B1 20 25230283 29694 999 23998 c0:=floor(mod(i-1,9)/3)*3+1;
SD3B1 22 45839881 296940 0 54996 for j in 1..9 loop
SD3B1 23 98367308 267246 0 29997 n:=(r-1)*9+j;
SD3B1 24 298883668 267246 999 114992 if substr(a,n,1)>0 and bitand(e,power(2,substr(a,n,1)))=0 then
SD3B1 25 55550221 183790 0 23998 e:=e+power(2,substr(a,n,1));
SD3B1 29 40097272 267246 0 30997 for j in 1..9 loop
SD3B1 30 135039813 267246 0 489966 n:=(j-1)*9+c;
SD3B1 31 272523461 267246 999 194986 if substr(a,n,1)>0 and bitand(e,power(2,substr(a,n,1)))=0 then
SD3B1 32 14270029 45441 0 14998 e:=e+power(2,substr(a,n,1));
SD3B1 36 39582307 267246 0 37997 for j in 1..9 loop
SD3B1 37 492958466 267246 999 122991 n:=(r0+floor((j-1)/3)-1)*9+c0+mod(j-1,3);
SD3B1 38 276345201 267246 999 66995 if substr(a,n,1)>0 and bitand(e,power(2,substr(a,n,1)))=0 then
SD3B1 39 2473831 8321 999 18998 e:=e+power(2,substr(a,n,1));
SD3B1 43 40046275 267246 0 26998 for m in 1 ..9 loop
SD3B1 44 281502850 267246 999 56996 if bitand(e,power(2,m))=0 then
SD3B1 47 43579035 29694 999 734950 sd3b1(substr(a,1,i-1)||m||substr(a,i+1));
SD3B1 50 6054588 29694 4999 6999 end;
已选择28行。
已用时间: 00: 00: 00.11
SQL> exec sd3b1('200370009009200007001004002050000800008000900006000040900100500800007600400089001');
284375169639218457571964382152496873348752916796831245967143528813527694425689731
PL/SQL 过程已成功完成。
已用时间: 00: 00: 01.15
|
|