ベルク・カッツェ |
2が1番目に書かれる場合
22×× 36通り 211× 6通り 2が2番目に書かれる場合 112× 6通り 1111 1通り 合計49通りです。 |
4月28日(木) 0:06:29
51461 |
紫の薔薇の人 |
樹形図を描いて終わりです。
1−1−1−1 +2−* 2−1−1−* +2−*−* 1+6+6+36=49通り |
4月28日(木) 0:08:10
51462 |
みかん |
記録用紙―さいころの目 の対応を整理。問題文の例なら
2、5、10、11―2、3、5、1 と表す。 記録用紙に2と4が出るのは以下のパターン。「それまでに出た和」の記録だから、 2より4が右になる。 2、4、□、□―2、2、?、? →6×6=36通り 2、□、4、□―2、1、1、? →6通り □、2、4、□―1、1、2、? →6通り 2、□、□、4 →不可(記録用紙の1つめが2のとき、4つめは最低でも5になるため) □、2、□、4―1、1、1、1 →1が4つのみの1通り □、□、2、4 →不可(記録用紙の3つめは最低でも3になるため) 以上より、36+6+6+1=49通り が答え。 −−−−−−−−−− 今回は楽勝じゃんと思っていたら、足し算を間違えていました。 易しそうな問題のときこそ慎重さを持ちたいものです。 |
4月28日(木) 0:47:18
51463 |
「数学」小旅行 |
1+6+6+36となりました。 |
4月28日(木) 4:01:30
51464 |
「数学」小旅行 |
正解者一覧の表の下の日時表示が変です。現時点で、
>以上の方が4月27日午後9時16分現在の正解者です。 |
4月28日(木) 4:10:30
51465 |
「数学」小旅行 |
Rubyプログラムです。
p (1..6).to_a.repeated_permutation(4).map{|x|s=0;x.map{|y|s=s+y}}.select{|z|z.include?(2)&z.include?(4)}.size もっと簡単になるのかなぁ? |
4月28日(木) 6:38:04
51466 |
最後の手描き図面職人 |
パイソンプログラムを作り解いてみました。プログラムは
added=[] b=[] sum=0 for i in range(1,7): for j in range(1,7): for k in range(1,7): for l in range(1,7): a=[i,i+j,i+j+k,i+j+k+l] added.append(a) print(added) print(len(added)) for m in range(len(added)): c0=str(added[m][0]) c1=str(added[m][1]) c2=str(added[m][2]) c3=str(added[m][3]) b.append([c0,c1,c2,c3]) print(b) print(len(b)) for n in range(len(added)): if (b[n][0]=='2' or b[n][1]=='2' or b[n][2]=='2' or b[n][3]=='2') and (b[n][0]=='4' or b[n][1]=='4' or b[n][2]=='4' or b[n][3]=='4'): sum=sum+1 print('答え=',sum) |
4月28日(木) 15:07:25
MAIL:syokyuhsya@gmail.com 51467 |
ゴンとも |
十進Basic で
for a=1 to 6 for b=1 to 6 let a1=a+b for c=1 to 6 let a2=a+b+c for d=1 to 6 let a3=a+b+c+d if a=2 and a1=4 then let s1=s1+1 if a=2 and a2=4 then let s2=s2+1 if a1=2 and a2=4 then let s3=s3+1 if a1=2 and a3=4 then let s4=s4+1 next d next c next b next a print s1;"+";s2;"+";s3;"+";s4;"=";s1+s2+s3+s4 end f9押して 36+6+6+1=49・・・・・・(答え) |
4月28日(木) 17:29:59
51468 |
最後の手描き図面職人 |
問題の通りに、プログラムしてみました。 |
4月28日(木) 18:30:08
MAIL:syokyuhsya@gmail,com 51469 |
最後の手描き図面職人 |
プログラムに不要な部分があったので変更します。
added=[] sum=0 for i in range(1,7): for j in range(1,7): for k in range(1,7): a=[i,i+j,i+j+k,i+j+k+l] added.append(a) print(added) for m in range(len(added)): if (added[m][0]==2 or added[m][1]==2 or added[m][2]==2 or added[m][3]==2) and (added[m][0]==4 or added[m][1]==4 or added[m][2]==4 or added[m][3]==4): sum=sum+1 print('答え=',sum) |
4月29日(金) 8:50:27
MAIL:syokyuhsya@gmail.com 51470 |
「数学」小旅行 |
Rubyプログラムですが、普通の流れで書くと
c=0 for i in 1..6 for j in 1..6 for k in 1..6 for l in 1..6 x=i+j;y=x+k;z=y+l if i==1 then if x==2 then if y==3 then if z==4 then c+=1 end elsif y==4 then c+=1 end end elsif i==2 if x==3 then if y==4 then c+=1 end elsif x==4 c+=1 end end end end end end p c |
4月29日(金) 16:54:20
51471 |
中DA |
問題が易しくなりましたね、、、
中体連🏓市大会を突破し、県大会に出場します! |
4月29日(金) 17:02:52
51472 |
中DA |
卓球部でーす |
天界
4月29日(金) 17:09:44
51473 |
「数学」小旅行 |
Rubyプログラムで、下ので、Arrayのmethodをひとつ許してもらうと、
c=0 for i in 1..6 for j in 1..6 for k in 1..6 for l in 1..6 x=i+j;y=x+k;z=y+l if [i,x,y,z].intersection([2,4])==[2,4] then c+=1 end end end end end p c |
4月29日(金) 17:18:24
51474 |
Mr.ダンディ |
例えば、6,6,1,1 と出れば 記入される数は 6,12,13,14
このとき 2も4も記入されている と考え、こういう場合もカウントしていくものと解釈して計算しておりました。 すると 大変な場合分けが生じ 苦戦していたところ、もしや・・12,22,14,24 などはダメなのかとすると 瞬時に49通りが出ました。 こういう解釈をしていたのは私だけ ???? |
5月2日(月) 22:15:15
51475 |
SECOND |
記入される数だけを見ると、単調増大で、「2」「4」の並びは、何番目から始まっても、24 と、234 の2通り。
3番目以上からの並びは、有り得ないので除くと、以下の4通りしかない。ベルク・カッツェさんと全く同じ #51461 24** 「*」は、それぞれ6通り。 234* 124* 1234 |
5月3日(火) 17:23:31
51476 |
最後の手描き図面職人 |
#########################
##### ブロック崩し ##### ######################### import tkinter as tk from tkinter import messagebox #ウインドウ win=tk.Tk() win.title("ブロック崩し") win.geometry("425x625") win.resizable(False,False) #キャンバス can=tk.Canvas(bg="black",width=400,height=600) can.place(x=10,y=10) #ゲームオーバー def gameOver(): messagebox.showinfo("Information","GAME OVER!") exit() #ゲームクリア def gameClear(): messagebox.showinfo("Information","CONGRATULATIONS!!!!") exit() #ボール ball_x=50; ball_y=500; bx=5; by=-5 def drawBall(): global ball_x,ball_y,bx,by can.create_oval(ball_x,ball_y,ball_x+20,ball_y+20,fill="white") if ball_x<=0 or ball_x>=385: bx*=-1 if ball_y<=0: by*=-1 if ball_y>=603: gameOver() if ball_y>=560 and ball_x>=rack_x-10 and ball_x<=rack_x+50: by*=-1 ball_x+=bx;ball_y+=by #ラケット rack_x=170;keyPress_R=False;keyPress_L=False def rightKeyPress(event): global keyPress_R keyPress_R=True def rightKeyRelease(event): global keyPress_R keyPress_R=False def leftKeyPress(event): global keyPress_L keyPress_L=True def leftKeyRelease(event): global keyPress_L keyPress_L=False win.bind("<KeyPress-Right>",rightKeyPress) win.bind("<KeyRelease-Right>",rightKeyRelease) win.bind("<KeyPress-Left>",leftKeyPress) win.bind("<KeyRelease-Left>",leftKeyRelease) def drawRacket(): global rack_x can.create_rectangle(rack_x,580,rack_x+60,595,fill="white") if keyPress_R==True and rack_x<=350: rack_x+=5 if keyPress_L==True and rack_x>=-10: rack_x-=5 #ブロック block=[] for x in range(5): for y in range(4): block.append({"x":x*80+5,"y":y*40+10,"st":1}) def drawBlock(): global ball_x,ball_y,by block_count=0 for i in range(len(block)): x=block[i]["x"] y=block[i]["y"] st=block[i]["st"] if ball_y<=y+30 and ball_x>=x-10 and ball_x<=x+60 and st==1: by*=-1 block[i]["st"]=0 if st==1: can.create_rectangle(x,y,x+70,y+30,fill="white") block_count+=1 if block_count==0: gameClear() #表示ループ def gameLoop(): can.delete("all") drawBall() drawRacket() drawBlock() win.after(15,gameLoop) gameLoop() #ウインドウループ win.mainloop() コピー貼り付け、出来るんですね。 |
5月4日(水) 9:09:46
51477 |