過去ログ

ミキティ
C-D 君、トップおめ。ひょっとして「トライアスロンV」
(AЯOTさん出題) の正解を探されましたか?(ぉ

> また、この整数は、各位に使われる数字が全て異なっています。
たくさんありそうなので、自主的にこの条件を加えて解きました。
が、プログラムを何回も書き間違えました。○| ̄|_

※ 10億の位から順に、a1,a2,……,a10 とおく。
110 for a1=1 to 9 step 2
120 for a2=2 to 8 step 2
130 for a3=1 to 9 step 2
131 if a3=a1 then goto 470
140 for a4=2 to 8 step 2
142 if a4=a2 then goto 460
150 a5=5
160 for a6=2 to 8 step 2
162 if a6=a2 then goto 440
164 if a6=a4 then goto 440
170 for a7=1 to 9 step 2
171 if a7=a1 then goto 430
173 if a7=a3 then goto 430
175 if a7=a5 then goto 430
180 for a8=2 to 8 step 2
182 if a8=a2 then goto 420
184 if a8=a4 then goto 420
186 if a8=a6 then goto 420
190 for a9=1 to 9 step 2
191 if a9=a1 then goto 410
193 if a9=a3 then goto 410
195 if a9=a5 then goto 410
197 if a9=a7 then goto 410
200 LET a10=0
220 if mod(a1+a2+a3,3)<>0 then goto 410
230 if mod(10*a3+a4,4)<>0 then goto 410
250 if mod(a1+a2+a3+a4+a5+a6,3)<>0 then goto 410
270 if mod(10^6*a1+10^5*a2+10^4*a3+10^3*a4+10^2*a5+10*a6+a7,7)<>0 then goto 410
280 if mod(100*a6+10*a7+a8,8)<>0 then goto 410
290 if mod(a1+a2+a3+a4+a5+a6+a7+a8+a9,9)<>0 then goto 410
300 print a1;a2;a3;a4;a5;a6;a7;a8;a9;a10
410 next a9
420 next a8
430 next a7
440 next a6
460 next a4
470 next a3
480 next a2
490 next a1
500 end

print:
3816547290 //
   6月24日(木) 0:22:24     23116

過去問題一覧へ戻る