ޥ
ʤѥʤΤǤ򤱤ֲפȻפäƤФȤȤ...
MBP 227ڡ 0:13:43 HomePage:48798
ޥ
ʸꡢн褷ޤϤޤľкޤ...m(__)m
MBP 227ڡ 0:15:06 HomePage:48799
٥륯åĥ
PACB¦ˤȤͳѷAPBCѤ1.5ʾ2ʲʤΤǡդABȤȤλѷPABι⤵ѷCAB0.5ܤ1ܤˤʤϰϤǡ22-1.51.51.75ˤʤޤ
PACBĺѤ¦ˤȤդABȤȤλѷPABι⤵ѷCABι⤵1.5ܤ2ܤˤʤФΤǡϰϤ11-0.50.50.75ˤʤޤ
줾3ƱͤοޤǤΤǡ1.75+0.75ˡ37.5ˤʤޤ
227ڡ 0:16:49 48800
̻
Υ٥ȣ꤬̾ϥߥ
⵭ǰȤޤ

դ򿭤Ф˳դʿҤ
ѷˤޤѤcm2飳cm2ϰϤ
ʤˤȤޤ
227ڡ 0:29:31 48801
³bot
񤭹ߤǤ
⤷ơǯϿ2ƱǤ
227ڡ 0:45:03 48802
ǯ
褯ɤޤޤߤơѷĤ¤Ƿ׻Ƥ
227ڡ 0:45:23 48803
³bot
񤭹ߤǤ
⤷ơǯϿ2ƱǤ
227ڡ 0:47:23 48804
鯤ο
ʿ̤ľABBCCAǶڤ룷ĤΰʬPΰưȤ
ľͤޤ

ޤФABC˼ȡ¤ϣˤʤäƤޤΤdzޤ

ˡPCAAγ˱ĹľˤȤȡΤϡ
ĹCA1/2ܤQ1ܤDϰ(ʬQD)ʬޤ

ˡPQDˤȤꡢABʿԤ˰ưƤ⡢¤Ѥޤ
ˡPQDˤȤꡢBCʿԤ˰ưƤ⡢¤Ѥޤ

ΤȤ顢

CAAγCA1/2ܤĹQCA1ܤĹD
CBBγCB1/2ܤĹRCB1ܤĹE
ABBγAB1/2ܤĹSAB1ܤĹF
ACCγAC1/2ܤĹTAC1ܤĹG
BCCγBC1/2ܤĹUBC1ܤĹH
BAAγBA1/2ܤĹVBA1ܤĹI

ȤȡդABCդʿԤʣĤΣѷQRSTUVȡ
DEFGHI˶ޤ줿ΰ褬ΰˤʤޤ
(4-9/4)*3+(1-1/4)*315/2
227ڡ 0:51:27 48805
̻
ۤȡƱǤ³bot
ǽꤹޥ뤵󡢴ޤ
227ڡ 0:55:31 48806
鯤ο
#48805

>ˡPQDˤȤꡢABʿԤ˰ưƤ⡢¤Ѥޤ
>ˡPQDˤȤꡢBCʿԤ˰ưƤ⡢¤Ѥޤ

ľǶڤ줿ΰư

227ڡ 0:59:32 48807
٥륯åĥ
긫ƤޤޤäƱǤ͡

ä˺Ƥޤ롦á 󤬻Ǥ
227ڡ 1:09:20 48808
ˤ⡼
ȤꤢŻDz򤱤ư¿
ǤޤʤʸDzΤݡ

¤ȣ£äȣäĹƢ£äγ¦򣶤Ĥΰʬ
Ĥΰϡʲέʬ졢Фɤ뤫ͤ롣
ʬУäʬ¡ʬУ¤ʬáʬУʬ£äȸۣʸ򤹤ȡФȣäʬ¤дߤˤ롢ߤʡ

ΰʳ

ξ硢Ѥϡ7/4ߣ21/4
ξ硡Ѥϡ3/4ߣ9/4
碌ơ15/2
¡ 227ڡ 1:10:37 HomePage:˥ͥäΥڡ48809
鯤ο
򱡢ۥ 󤬻Ǥ

ϽФǤ͡
227ڡ 1:20:09 48810
ޥ
ϤǯʤϡˤǤפ鷺֤졢ʸϤΤۤäʡפȤפäƤޤޤ1.ʸϰϤDz򤱤äΤ...

ꤷΤϤμȴǤˤäƤߤƤ餦ΤɤʡȻפäΤ¤ǡ
MBP 227ڡ 1:43:31 HomePage:48811
ֿء׾ι
ȲΤǰƤޤäƤޤ
227ڡ 7:42:39 48812
CRYING DOLPHIN
ѳʻҤ񤤤ƹͤޤѷͻҤ䤹äǤ
ttp://http://cdcdcd.sansu.org/pika/junkfoods/san1-q1125-2kara3ryoiki.png
(hȴɽϤϤ䥤󥿡ͥåϷͲƤ)

캣ǯʤǤ͡
ۤ2ȤƤѤǤ
夲ƻ衡 227ڡ 8:32:50 MAIL:Ԥ HomePage:ԤԤ󤹤48813
~~
ä֤ǤϳھäΤ?
ǤϽä٥ʤΤ
εդꡡ 227ڡ 10:27:19 48814
baLLjugglermoka
ǶỻȥڥȤ鷺Żǥ󥸤ƤޤϰŻǴְ㤨ޤ겿ȤŻ򤷤ޤϤǤ^^;Ǥեġ˻Dz򤱤Ǥ͡
227ڡ 16:15:09 48815
⡼ޥ
ߤʤƱǤ ^^

դ˴ؤ...2^2-1.5^2=3.5*0.5=1.75=7/4
ĺ¦˴ؤ...1*(1-1/4)=3/4
so...
(7/4+3/4)*3=(10/4)*3=30/4=15/2=7.5

򤱤鵤Ǥ͢
(ޤ)
227ڡ 16:59:00 48816
Mr.ǥ
ޤǡ3פʬΤǡ󤫸Ƥޤ
ʤۤ񤷤ʤˤ϶路ޤ
227ڡ 19:49:21 48817
Mr.ǥ
#48817
>ֿޤǡ3פʬΤǡ
ȤΤϡ錄ưϰϤǤοޤǤΤȤǡˤޤǤΤ
ȤǤϤޤ
ʸ򤦤ߤʤΤǡ褦ȤΤǤǤʤΤǡפäơǤפޤ
227ڡ 23:50:09 48818
Ȥ
ؤꤽΤΤäȤ϶äǤ!!
ؤ5֤򽽿Basic ǤäƤߤޤ!!

for a=1 to 4
for b=1 to 4
for c=1 to 4
for d=1 to 4
IF a*b*c*d<>24 or a+b+c+d<>10 then goto 130
for e=1 to 4
for f=1 to 4
for g=1 to 4
for h=1 to 4
IF e*f*g*h<>24 or e+f+g+h<>10 then goto 90
for i=1 to 4
for j=1 to 4
for k=1 to 4
for l=1 to 4
IF i*j*k*l<>24 or i+j+k+l<>10 then goto 50
for m=1 to 4
IF a*e*i*m<>24 or a+e+i+m<>10 then goto 40
for n=1 to 4
IF b*f*j*n<>24 or b+f+j+n<>10 then goto 30
for o=1 to 4
IF c*g*k*o<>24 or c+g+k+o<>10 then goto 20
for p=1 to 4
IF d*h*l*p<>24 or d+h+l+p<>10 then goto 10
IF m*n*o*p<>24 or m+n+o+p<>10 then goto 10
let s=s+1
10 next p
20 next o
30 next n
40 next m
50 next l
60 next k
70 next j
80 next i
90 next h
100 next g
110 next f
120 next e
130 next d
140 next c
150 next b
160 next a
print s
end

f9ơ576()

긫ƥץ񤤤10ʬǤޤ
ǤȤäȥ礭ƥؤǤΤ-

˭ԡ 228ʶ 9:31:13 MAIL:fttnm528@ybb.ne.jp 48819
ʪ
פ??ȻפääǤ͡
μDz򤱤ƤޤΡ
ܡ 228ʶ 19:04:42 MAIL:butsuri.0523@gmail.com HomePage:Twitter48820
̤ꤹι
Ϥ2֤Ǥ͡
ǽ顢ABCP̻ͳѷȤʤ礷θƤ餺̵¤ϰϤ뵤Ƥޤ򤱤˥åꤷޤɤȻפޤ
31 0:29:43 48821
̤ꤹι
2ܤ˽ФƤȤոȤƤ狼ޤ
31 0:33:39 48822
ʪ
#48819
CˤơƵѤơġ־ιԤ1 2 3 4 ... N˸ꤷưֺ1 2 3 4 ... Nˤʤ褦¤ؤ뤳ȤꤷǺǸ (N! * (N-1)!) ݤȤˤǼȡN=7ޤǤϼ긵PCǤ⽼ʬ®(1ʬ̤)˵ޤ

#include<stdio.h>

long long factorial(long long x){
long long i,r=1;
for(i=x;i>=1;i--){
r*=i;
}
return r;
}

long long n;
long long res=0;
long long row[16][16]={0},column[16][16]={0};
long long latin_sq[16][16];

void rec(long long a,long long b){
if(b==n){a++;b=0;}
if(a==n){res++;return;}
long long i;
for(i=1;i<=n;i++){
if(a==0 && b!=(i-1)){continue;}
if(b==0 && a!=(i-1)){continue;}
if(row[a][i]==1 || column[b][i]==1){continue;}
row[a][i]=1;column[b][i]=1;
latin_sq[a][b]=i;
rec(a,b+1);
row[a][i]=0;column[b][i]=0;
}
}

int main(){
scanf("%lld",&n);
rec(0,0);
printf("%lld\n",res*factorial(n)*factorial(n-1));
}

ʾȤ߹碌ȯ˻Ȥ뤯餤ˤͤ粽Ƥޤޤ͡
https://oeis.org/A002860
https://en.wikipedia.org/wiki/Combinatorial_explosion
ܡ 31 19:30:31 MAIL:butsuri.0523@gmail.com HomePage:Twitter48823
ˤ⡼
ˤϻߤ빽ФǤ͡

ǯΰ춶ؤˡϰϤDz򤱤꤬ޤ
ɽ򻻿ǽФ褦ľޤ

򣱣󤫤ʤ
dzä;ϡ̭ͤǤ
ޤǡư̤¤ȤʤΤΤ
dzڤΤθĿϡ̭ͤǤ

ʣǯؼνʤΤǡºݤؼǽ̵Ǥ礦ɡ
ȡϰϤǤСΡפס
¡ 32ʷ 20:56:49 HomePage:˥ͥäΥڡ48824
Ȥ
#48823
ʪ 󡡥쥹꤬Ȥޤ
Ȥ߹碌ȯŵ11*11ޤǤ餤ǻߤޤäƤǤ͡
7*7ϼʬǤäƤߤޤ!!
Basic ƥؤ

(001)(002)(003)(004)(005)(006)(007)
(002)(a01)(a02)(a03)(a04)(a05)(a06)
(003)(a07)(a08)(a09)(a10)(a11)(a12)
(004)(a13)(a14)(a15)(a16)(a17)(a18)
(005)(a19)(a20)(a21)(a22)(a23)(a24)
(006)(a25)(a26)(a27)(a28)(a29)(a30)
(007)(a31)(a32)(a33)(a34)(a35)(a36)

Ȥa1,a36ޤǤ̤7!*6!
7^2ΥƥؤȤʤ롣

PRINT TIME$
for a1=1 to 7
if a1=2 then goto 360
for a2=1 to 7
if a2=a1 or a2=2 or a2=3 then goto 350
for a3=1 to 7
if a3=a1 or a3=a2 or a3=2 or a3=4 then goto 340
for a4=1 to 7
if a4=a1 or a4=a2 or a4=a3 or a4=2 or a4=5 then goto 330
for a5=1 to 7
if a5=a1 or a5=a2 or a5=a3 or a5=a4 or a5=2 or a5=6 then goto 320
for a6=1 to 6
if a6=2 then goto 310
if a6=a1 or a6=a2 or a6=a3 or a6=a4 or a6=a5 then goto 310
for a7=1 to 7
IF a7=a1 OR a7=3 OR a7=2 THEN GOTO 300
for a8=1 to 7
IF a8=a2 OR a8=a7 OR a8=3 THEN GOTO 290
for a9=1 to 7
IF a9=a3 OR a9=a7 OR a9=a8 OR a9=3 OR a9=4 THEN GOTO 280
for a10=1 to 7
IF a10=a4 OR a10=a7 OR a10=a8 OR a10=a9 OR a10=3 OR a10=5 THEN GOTO 270
for a11=1 to 7
IF a11=a5 OR a11=a7 OR a11=a8 OR a11=a9 OR a11=a10 OR a11=3 OR a11=6 THEN GOTO 260
for a12=1 to 6
IF a12=a6 OR a12=a7 OR a12=a8 OR a12=a9 OR a12=a10 OR a12=a11 OR a12=3 THEN GOTO 250
for a13=1 to 7
IF a13=a1 OR a13=a7 OR a13=4 OR a13=2 THEN GOTO 240
for a14=1 to 7
IF a14=a2 OR a14=a8 OR a14=a13 OR a14=4 OR a14=3 THEN GOTO 230
for a15=1 to 7
IF a15=a3 OR a15=a9 OR a15=a13 OR a15=a14 OR a15=4 THEN GOTO 220
for a16=1 to 7
IF a16=a4 OR a16=a10 OR a16=a13 OR a16=a14 OR a16=a15 OR a16=4 OR a16=5 THEN GOTO 210
for a17=1 to 7
IF a17=a5 OR a17=a11 OR a17=a13 OR a17=a14 OR a17=a15 OR a17=a16 OR a17=4 OR a17=6 THEN GOTO 200
for a18=1 to 6
IF a18=a6 OR a18=a12 OR a18=a13 OR a18=a14 OR a18=a15 OR a18=a16 OR a18=a17 OR a18=4 THEN GOTO 190
for a19=1 to 7
IF a19=a1 OR a19=a7 OR a19=a13 OR a19=5 OR a19=2 THEN GOTO 180
for a20=1 to 7
IF a20=a2 OR a20=a8 OR a20=a14 OR a20=a19 OR a20=5 OR a20=3 THEN GOTO 170
for a21=1 to 7
IF a21=a3 OR a21=a9 OR a21=a15 OR a21=a19 OR a21=a20 OR a21=5 OR a21=4 THEN GOTO 160
for a22=1 to 7
IF a22=a4 OR a22=a10 OR a22=a16 OR a22=a19 OR a22=a20 OR a22=a21 OR a22=5 THEN GOTO 150
for a23=1 to 7
IF a23=a5 OR a23=a11 OR a23=a17 OR a23=a19 OR a23=a20 OR a23=a21 OR a23=a22 OR a23=5 OR a23=6 THEN GOTO 140
for a24=1 to 6
IF a24=a6 OR a24=a12 OR a24=a18 OR a24=a19 OR a24=a20 OR a24=a21 OR a24=a22 OR a24=a23 OR a24=5 THEN GOTO 130
for a25=1 to 7
IF a25=a1 OR a25=a7 OR a25=a13 OR a25=a19 OR a25=6 OR a25=2 THEN GOTO 120
for a26=1 to 7
IF a26=a2 OR a26=a8 OR a26=a14 OR a26=a20 OR a26=a25 OR a26=6 OR a26=3 THEN GOTO 110
for a27=1 to 7
IF a27=a3 OR a27=a9 OR a27=a15 OR a27=a21 OR a27=a25 OR a27=a26 OR a27=6 OR a27=4 THEN GOTO 100
for a28=1 to 7
IF a28=a4 OR a28=a10 OR a28=a16 OR a28=a22 OR a28=a25 OR a28=a26 OR a28=a27 OR a28=6 OR a28=5 THEN GOTO 90
for a29=1 to 7
IF a29=a5 OR a29=a11 OR a29=a17 OR a29=a23 OR a29=a25 OR a29=a26 OR a29=a27 OR a29=a28 OR a29=6 THEN GOTO 80
for a30=1 to 5
IF a30=a6 OR a30=a12 OR a30=a18 OR a30=a24 OR a30=a25 OR a30=a26 OR a30=a27 OR a30=a28 OR a30=a29 THEN GOTO 70
for a31=1 to 6
IF a31=a1 OR a31=a7 OR a31=a13 OR a31=a19 OR a31=a25 OR a31=7 OR a31=2 THEN GOTO 60
for a32=1 to 6
IF a32=a2 OR a32=a8 OR a32=a14 OR a32=a20 OR a32=a26 OR a32=a31 OR a32=7 OR a32=3 THEN GOTO 50
for a33=1 to 6
IF a33=a3 OR a33=a9 OR a33=a15 OR a33=a21 OR a33=a27 OR a33=a31 OR a33=a32 OR a33=7 OR a33=4 THEN GOTO 40
for a34=1 to 6
IF a34=a4 OR a34=a10 OR a34=a16 OR a34=a22 OR a34=a28 OR a34=a31 OR a34=a32 OR a34=a33 OR a34=7 OR a34=5 THEN GOTO 30
for a35=1 to 6
IF a35=a5 OR a35=a11 OR a35=a17 OR a35=a23 OR a35=a29 OR a35=a31 OR a35=a32 OR a35=a33 OR a35=a34 OR a35=7 OR a35=6 THEN GOTO 20
for a36=1 to 6
IF a36=a6 OR a36=a12 OR a36=a18 OR a36=a24 OR a36=a30 OR a36=a31 OR a36=a32 OR a36=a33 OR a36=a34 OR a36=a35 THEN GOTO 10
let s=s+1
10 next a36
20 next a35
30 next a34
40 next a33
50 next a32
60 next a31
70 next a30
80 next a29
90 next a28
100 next a27
110 next a26
120 next a25
130 next a24
140 next a23
150 next a22
160 next a21
170 next a20
180 next a19
190 next a18
200 next a17
210 next a16
220 next a15
230 next a14
240 next a13
250 next a12
260 next a11
270 next a10
280 next a9
290 next a8
300 next a7
310 next a6
320 next a5
330 next a4
340 next a3
350 next a2
360 next a1
print s
PRINT TIME$
END

f9
22:21:00
16942080
22:44:19

ꡡ16942080*7!*6!;
61479419904000(7*7Υƥؤ)

¹Ի֤23ʬ19äȤΤ⡦
2011ǯνեǥaspire5750G(̾)
cpucore i72(sandy bridge)ǡ
2003ΥƱץ2.5ܤ餤®äǤɡ
CΥѥǤľȤǤ͡
˭ԡ 32ʷ 23:04:52 MAIL:fttnm528@ybb.ne.jp 48825
Ф
ؤäݤɤԤäȤƤ롣
ͧãȡΤǤʤפȸäƤä
34ʿ 21:20:45 48826
ֿء׾ι
Ϥ٤ߤȤȤǤΤǡˤʤäƤΥץͤƤߤޤƤȤäƤޤ

ߣΤȤϥȤƤۤȤɤ˽ФƤޤ
# 1125󡡵
row=Array.new();col=Array.new()
1.upto(5){|i|row[i-1]=[0,0,0,0,0];col[i-1]=[0,0,0,0,0]}
#ܤ򣱤飴ܤ⣱飴ˤޤ
1.upto(4){|i|row[1][i]=1;row[i][i]=1;col[1][i]=1;col[i][i]=1}
#countŬؤθĿǤ
count=0
# Ǥ򣱤飴ˤơ٤ƤξĴ٤ޤƹǴ˻Ȥ줿Ͻޤ
1.upto(4){|a22|if row[2][a22]==0&&col[2][a22]==0 then row[2][a22]=1;col[2][a22]=1
1.upto(4){|a23|if row[2][a23]==0&&col[3][a23]==0 then row[2][a23]=1;col[3][a23]=1
1.upto(4){|a24|if row[2][a24]==0&&col[4][a24]==0 then row[2][a24]=1;col[4][a24]=1
1.upto(4){|a32|if row[3][a32]==0&&col[2][a32]==0 then row[3][a32]=1;col[2][a32]=1
1.upto(4){|a33|if row[3][a33]==0&&col[3][a33]==0 then row[3][a33]=1;col[3][a33]=1
1.upto(4){|a34|if row[3][a34]==0&&col[4][a34]==0 then row[3][a34]=1;col[4][a34]=1
1.upto(4){|a42|if row[4][a42]==0&&col[2][a42]==0 then row[4][a42]=1;col[2][a42]=1
1.upto(4){|a43|if row[4][a43]==0&&col[3][a43]==0 then row[4][a43]=1;col[3][a43]=1
1.upto(4){|a44|if row[4][a44]==0&&col[4][a44]==0 then count+=1
end}; row[4][a43]=0;col[3][a43]=0
end}; row[4][a42]=0;col[2][a42]=0
end}; row[3][a34]=0;col[4][a34]=0
end}; row[3][a33]=0;col[3][a33]=0
end}; row[3][a32]=0;col[2][a32]=0
end}; row[2][a24]=0;col[4][a24]=0
end}; row[2][a23]=0;col[3][a23]=0
end}; row[2][a22]=0;col[2][a22]=0
end}
# ǸˣߣݤФޤ
p count*4*3*2*3*2

ǡˣߣĩǤʲΥץǤ§ŪʤΤ(ά)ޤ
# 1125󡡵 ߣξ
row=Array.new();col=Array.new()
1.upto(8){|i|row[i-1]=[0,0,0,0,0,0,0,0];col[i-1]=[0,0,0,0,0,0,0,0]}
#ܤ򣱤飷ܤ⣱飷ˤޤ
1.upto(7){|i|row[1][i]=1;row[i][i]=1;col[1][i]=1;col[i][i]=1}
#countŬؤθĿǤ
count=0; p Time.now
# Ǥ򣱤飷ˤơ٤ƤξĴ٤ޤƹǴ˻Ȥ줿ϻȤޤ
1.upto(7){|a22|if row[2][a22]==0&&col[2][a22]==0 then row[2][a22]=1;col[2][a22]=1
1.upto(7){|a23|if row[2][a23]==0&&col[3][a23]==0 then row[2][a23]=1;col[3][a23]=1
1.upto(7){|a24|if row[2][a24]==0&&col[4][a24]==0 then row[2][a24]=1;col[4][a24]=1
1.upto(7){|a25|if row[2][a25]==0&&col[5][a25]==0 then row[2][a25]=1;col[5][a25]=1
1.upto(7){|a26|if row[2][a26]==0&&col[6][a26]==0 then row[2][a26]=1;col[6][a26]=1
1.upto(7){|a27|if row[2][a27]==0&&col[7][a27]==0 then row[2][a27]=1;col[7][a27]=1
1.upto(7){|a32|if row[3][a32]==0&&col[2][a32]==0 then row[3][a32]=1;col[2][a32]=1
1.upto(7){|a33|if row[3][a33]==0&&col[3][a33]==0 then row[3][a33]=1;col[3][a33]=1
ά
1.upto(7){|a76|if row[7][a76]==0&&col[6][a76]==0 then row[7][a76]=1;col[6][a76]=1
1.upto(7){|a77|if row[7][a77]==0&&col[7][a77]==0 then count+=1
end}; row[7][a76]=0;col[6][a76]=0
ά
end}; row[2][a23]=0;col[3][a23]=0
end}; row[2][a22]=0;col[2][a22]=0
end}
# ǸˣߣݤФޤ
p count*7*6*5*4*3*2*6*5*4*3*2
p Time.now

ä֤ϣʬäǤCorei5-4200M_2.50GHz_RAM8.00G
lenovoL540ΡȥѥȤޤ

ץ񤤤ƤߤơƵƤӽФɤʤΤ褯狼ޤʡ!!
35ڡ 14:13:43 48827
ޤ
ν꤬ʤäΤǤǡ֤˹礤ޤ(^^;
somewhere in the world 35ڡ 18:53:07 48828
ֿء׾ι
ƵؿȤäƤߤޤ
®äǤƱڥåǡʬäǤ

# 1125󡡵 77ξ

$row=Array.new();$col=Array.new() #ХѿȤޤ
1.upto(8){|i| $row[i-1]=[0,0,0,0,0,0,0,0];$col[i-1]=[0,0,0,0,0,0,0,0]} #1ܤrow[1]1ܤcol[1]ɽ魯88Ȥޤ
1.upto(7){|i|$row[1][i]=1;$row[i][i]=1;$col[1][i]=1;$col[i][i]=1} #ܤ򣱤7ܤ⣱7ˤޤ
$count=0; #$countؤθĿǤ

#ƵؿʬǤ
#ʣᡤʬ򣱤飷ޤѲοԤӣˤ뤫ɤȽꤷơʤФοʣᡤʬȤιʬ˿ʤƱ褦Ƥ椯ؿޤ
#ʣǤޤ콪뤳ȤǤ饫ȤƤ顢ޤҤȤΰ֤äƼοʣ飷ˤĴ٤ƹԤȤˤޤ
def seibunsirabe(a,b)
1.upto(7){|i|
if $row[a][i]==0&&$col[b][i]==0 then;if a==7&&b==7 then$count+=1 else
$row[a][i]=1;$col[b][i]=1;b==7 ? seibunsirabe(a+1,2):seibunsirabe(a,b+1) end
$row[a][i]=0;$col[b][i]=0 end }
end

seibunsirabe(2,2)#Ƶؿ¹Ԥޤ
p $count*7*6*5*4*3*2*6*5*4*3*2# Ǹ76ݤФޤ
36ʶ 11:12:42 48829
ֿء׾ι
ȤͷǤƤߤޤ󡣤ήǡʥץʿȡˤβˡץäƤߤޤ

# ʥСץ쥤ˡץ

$con=Array.new()
#Ϳ줿ޤ11ܤ$con[1][1]Ǥ
#(1,1)(9,9)˥ʥץϤޤ

$con[0]=[0,0,0,0,0,0,0,0,0,0]
$con[1]=[0,0,0,0,2,0,0,0,0,0]
$con[2]=[0,0,0,0,8,0,9,5,4,7]
$con[3]=[0,0,0,1,0,6,0,8,0,0]
$con[4]=[0,3,0,0,0,0,0,0,0,5]
$con[5]=[0,8,0,9,1,0,0,0,0,0]
$con[6]=[0,0,0,6,0,0,0,0,7,0]
$con[7]=[0,0,0,0,0,5,0,3,0,8]
$con[8]=[0,6,2,0,4,0,0,0,0,0]
$con[9]=[0,0,0,0,0,0,0,9,0,0]
#--------------------------------------
$row=Array.new();$col=Array.new();$sol=Array.new();$blk=Array.new() #ХѿȤޤ
$count=0;#$countؤθĿǤ
# abΥ֥åֹʣߣΥ֥å9Ĥ򺸾夫鱦ؤֹդޤˤ֤ޤ
def blkid(a,b)
return (b-1)/3+1+3*((a-1)/3)
end
1.upto(10){|i| $row[i-1]=[0,0,0,0,0,0,0,0,0,0];$col[i-1]=[0,0,0,0,0,0,0,0,0,0];$sol[i-1]=[0,0,0,0,0,0,0,0,0,0];$blk[i-1]=[0,0,0,0,0,0,0,0,0,0]} #1ܤrow[1]1ܤcol[1]ɽ魯88Ȥޤ
1.upto(9){|i|1.upto(9){|j| $row[i][$con[i][j]]=1;$col[j][$con[i][j]]=1;$blk[blkid(i,j)][$con[i][j]]=1}}#ƹ֥åǻȤƤåޤ
#---------------------------------------
#ƵؿʬǤ
#ʣᡤʬ򣱤飹ޤѲοԤӣˤ뤫ɤȽꤷơʤФοʣᡤʬȤιʬ˿ʤƱ褦Ƥ椯ؿޤ
#ʣǤޤ콪뤳ȤǤ饫ȤƤ顢ޤҤȤΰ֤äƼοʣ飹ˤĴ٤ƹԤȤˤޤ
def seibunsirabe(a,b)
if $con[a][b]==0 then 1.upto(9){|i|
if $row[a][i]==0&& $col[b][i]==0&& $blk[blkid(a,b)][i]==0 then $sol[a][b]=i
if a==9&&b==9 then $count+=1;1.upto(9){|j|p $sol[j]}
else $row[a][i]=1;$col[b][i]=1;$blk[blkid(a,b)][i]=1;b==9 ? seibunsirabe(a+1,1):seibunsirabe(a,b+1)
$row[a][i]=0;$col[b][i]=0;$blk[blkid(a,b)][i]=0 endend }
else $sol[a][b]=$con[a][b];if a==9&&b==9 then $count+=1;1.upto(9){|j|p $sol[j]}
else b==9 ? seibunsirabe(a+1,1):seibunsirabe(a,b+1) end end
end
seibunsirabe(1,1);p $count

ӡǼ¹ԤȲ򤬣ĽФޤ㤨СԣΣʤȤϲ򤬣̤ꤢȤФƤޤ
äפȳڤǤޤޤ꤬Ȥޤ
39ʷ 14:04:09 48830