過去ログ

ゴンとも
#49532
すみません自己レスで
PRINT s+1;"//";a;b;c;d;e;f;g;h;i;j;k;j;l
でなく
PRINT s+1;"//";a;b;c;d;e;f;g;h;i;j;k;lに変えないと
経路が重複してしまって訂正しました!!

図で道に以下のように番号を振り

/(18)/(22)/(24) 横棒
(12)(17)(21)(23)縦棒
/(11)/(16)/(22) 横棒
(06)(10)(15)(19)縦棒
/(05)/(09)/(14) 横棒
(02)(04)(08)(13)縦棒
/(01)/(03)/(07) 横棒

十進Basicですべての経路を番号を振り出してみました!!

FOR a=1 to 2
FOR b=3 to 6
if b=a then goto 110
if a=1 and (b<>3 and b<>4) then goto 110
if a=2 and (b<>5 and b<>6) then goto 110
FOR c=7 to 12
if c=a or c=b then goto 100
if b=3 and (c<>7 and c<>8) then goto 100
if b=4 and (c<>9 and c<>10) then goto 100
if b=5 and (c<>9 and c<>10) then goto 100
if b=6 and (c<>11 and c<>12) then goto 100
FOR d=13 to 18
if d=a or d=b or d=c then goto 90
if c=7 and d<>13 then goto 90
if c=8 and (d<>14 and d<>15) then goto 90
if c=9 and (d<>14 and d<>15) then goto 90
if c=10 and (d<>16 and d<>17) then goto 90
if c=11 and (d<>16 and d<>17) then goto 90
if c=12 and d<>18 then goto 90
FOR e=19 to 22
if e=a or e=b or e=c or e=d then goto 80
if d=13 and e<>19 then goto 80
if d=14 and e<>19 then goto 80
if d=15 and (e<>20 and e<>21) then goto 80
if d=16 and (e<>20 and e<>21) then goto 80
if d=17 and e<>22 then goto 80
if d=18 and e<>22 then goto 80
FOR f=23 to 24
if f=a or f=b or f=c or f=d or f=e then goto 70
if e=19 and f<>23 then goto 70
if e=20 and f<>23 then goto 70
if e=21 and f<>24 then goto 70
if e=22 and f<>24 then goto 70
FOR g=23 to 24
if g=a or g=b or g=c or g=d or g=e or g=f then goto 60
if f=23 and g<>24 then goto 60
if f=24 and g<>23 then goto 60
FOR h=19 to 22
if h=a or h=b or h=c or h=d or h=e or h=f or h=g then goto 50
if g=23 and (h<>19 and h<>20) then goto 50
if g=24 and (h<>21 and h<>22) then goto 50
FOR i=13 to 18
if i=a or i=b or i=c or i=d or i=e or i=f or i=g or i=h or (d+i=31 and d*i=15*16) then goto 40
if h=19 and (i<>13 and i<>14) then goto 40
if h=20 and (i<>15 and i<>16) then goto 40
if h=21 and (i<>15 and i<>16) then goto 40
if h=22 and (i<>17 and i<>18) then goto 40
FOR j=7 to 12
if j=a or j=b or j=c or j=d or j=e or j=f or j=g or j=h or j=i or (c+j=21 and c*j=110) or (c+j=17 and c*j=8*9) then goto 30
if i=13 and j<>7 then goto 30
if i=14 and (j<>8 and j<>9) then goto 30
if i=15 and (j<>8 and j<>9) then goto 30
if i=16 and (j<>10 and j<>11) then goto 30
if i=17 and (j<>10 and j<>11) then goto 30
if i=18 and j<>12 then goto 30
FOR k=3 to 6
if k=a or k=b or k=c or k=d or k=e or k=f or k=g or k=h or k=i or k=j or (b+k=9 and b*k=20) then goto 20
if j=7 and k<>3 then goto 20
if j=8 and k<>3 then goto 20
if j=9 and (k<>4 and k<>5) then goto 20
if j=10 and (k<>4 and k<>5) then goto 20
if j=11 and k<>6 then goto 20
if j=12 and k<>6 then goto 20
FOR l=1 to 2
if l=a or l=b or l=c or l=d or l=e or l=f or l=g or l=h or l=i or l=j or l=k then goto 10
if k=3 and l<>1 then goto 10
if k=4 and l<>1 then goto 10
if k=5 and l<>2 then goto 10
if k=6 and l<>2 then goto 10
PRINT s+1;"//";a;b;c;d;e;f;g;h;i;j;k;l
let s=s+1
10 next l
20 next k
30 next j
40 next i
50 next h
60 next g
70 next f
80 next e
90 next d
100 next c
110 next b
120 next a
END

1 // 1 3 7 13 19 23 24 21 15 9 5 2
2 // 1 3 7 13 19 23 24 21 16 10 5 2
3 // 1 3 7 13 19 23 24 21 16 11 6 2
4 // 1 3 7 13 19 23 24 22 17 10 5 2
5 // 1 3 7 13 19 23 24 22 17 11 6 2
6 // 1 3 7 13 19 23 24 22 18 12 6 2
7 // 1 3 8 14 19 23 24 21 16 10 5 2
8 // 1 3 8 14 19 23 24 21 16 11 6 2
9 // 1 3 8 14 19 23 24 22 17 10 5 2
10 // 1 3 8 14 19 23 24 22 17 11 6 2
11 // 1 3 8 14 19 23 24 22 18 12 6 2
12 // 1 3 8 15 20 23 24 22 17 10 5 2
13 // 1 3 8 15 20 23 24 22 17 11 6 2
14 // 1 3 8 15 20 23 24 22 18 12 6 2
15 // 1 4 9 14 19 23 24 21 16 11 6 2
16 // 1 4 9 14 19 23 24 22 17 11 6 2
17 // 1 4 9 14 19 23 24 22 18 12 6 2
18 // 1 4 9 15 20 23 24 22 17 11 6 2
19 // 1 4 9 15 20 23 24 22 18 12 6 2
20 // 1 4 10 16 20 23 24 22 18 12 6 2
21 // 2 5 9 15 21 24 23 19 13 7 3 1
22 // 2 5 10 16 21 24 23 19 13 7 3 1
23 // 2 5 10 16 21 24 23 19 14 8 3 1
24 // 2 5 10 17 22 24 23 19 13 7 3 1
25 // 2 5 10 17 22 24 23 19 14 8 3 1
26 // 2 5 10 17 22 24 23 20 15 8 3 1
27 // 2 6 11 16 21 24 23 19 13 7 3 1
28 // 2 6 11 16 21 24 23 19 14 8 3 1
29 // 2 6 11 16 21 24 23 19 14 9 4 1
30 // 2 6 11 17 22 24 23 19 13 7 3 1
31 // 2 6 11 17 22 24 23 19 14 8 3 1
32 // 2 6 11 17 22 24 23 19 14 9 4 1
33 // 2 6 11 17 22 24 23 20 15 8 3 1
34 // 2 6 11 17 22 24 23 20 15 9 4 1
35 // 2 6 12 18 22 24 23 19 13 7 3 1
36 // 2 6 12 18 22 24 23 19 14 8 3 1
37 // 2 6 12 18 22 24 23 19 14 9 4 1
38 // 2 6 12 18 22 24 23 20 15 8 3 1
39 // 2 6 12 18 22 24 23 20 15 9 4 1
40 // 2 6 12 18 22 24 23 20 16 10 4 1
豊川市   9月10日(木) 4:21:35   MAIL:fttnm528@ybb.ne.jp   49533

過去問題一覧へ戻る