Infron · Motif 3 · 46문항 × 3회 · Python TAR. 131,072 output tokens · 기본 1,800초 · 6+1 turns. ACC는 전체 138회, Pass@1은 각 문항의 첫 유효 시도, Pass@3는 3회 내 정답으로 계산합니다.
비어 있는 주머니 10개가 일렬로 놓여 있고, 공 8개가 있다. 각 주머니에 들어 있는 공의 개수가 2 이하가 되도록 공을 주머니에 남김없이 나누어 넣을 때, 다음 조건을 만족시키는 경우의 수를 구하시오. (단, 공끼리는 서로 구별하지 않는다.) (가) 들어 있는 공의 개수가 1인 주머니는 4개 또는 6개이다. (나) 들어 있는 공의 개수가 2인 주머니와 이웃한 주머니에는 공이 들어 있지 않다.
최종 정수 답을 안에 쓰세요.
Recorded Python call:
import itertools
count=0
cases={}
for seq in itertools.product([0,1,2], repeat=10):
if sum(seq)!=8:
continue
m=seq.count(1)
if m not in (4,6):
continue
ok=True
for i,x in enumerate(seq):
if x==2:
if i>0 and seq[i-1]!=0:
ok=False; break
if i<9 and seq[i+1]!=0:
ok=False; break
if ok:
count+=1
cases[m]=cases.get(m,0)+1
print(count, cases)
Recorded Python call:
import math
total=0
pairs=[]
for a in range(1,11):
for b in range(a+2,11):
M=set()
for p in (a,b):
if p>1: M.add(p-1)
if p<10: M.add(p+1)
m=len(M)
R=10-2-m
k=4-m
if 0<=k<=R:
ways=math.comb(R,k)
else:
ways=0
total+=ways
pairs.append((a,b,m,R,k,ways))
print(total)
from collections import Counter
print(Counter((a,b) for a,b,m,R,k,w in pairs if w))
Recorded Python call:
from collections import Counter
details=[]
for a in range(1,11):
for b in range(a+2,11):
M=set()
for p in (a,b):
if p>1: M.add(p-1)
if p<10: M.add(p+1)
m=len(M)
R=10-2-m
k=4-m
ways=math.comb(R,k) if 0<=k<=R else 0
details.append((a,b,m,R,k,ways))
print(Counter(d[5] for d in details))
for d in details:
if d[5]!=1:
print(d)
Recorded Python call:
import math
details=[]
for a in range(1,11):
for b in range(a+2,11):
M=set()
for p in (a,b):
if p>1: M.add(p-1)
if p<10: M.add(p+1)
m=len(M)
R=10-2-m
k=4-m
ways=math.comb(R,k) if 0<=k<=R else 0
details.append((a,b,m,R,k,ways))
from collections import Counter
print(Counter(d[5] for d in details))
for d in details:
if d[5]!=1:
print(d)
print(sum(d[5] for d in details))
2-주머니의 수를 , 1-주머니의 수를 , 공 없는 주머니의 수를 라 하면
이고, 조건 (가)에 의해 또는 이다.
-
이면 이다. 2가 하나 있을 때 그 이웃은 모두 공 없는 주머니여야 한다.
- 양끝에 2가 있으면: 가지, 이웃 1개가 강제 0, 남은 8자리 중 0 두 개 배치 씩 →
- 가운데에 2가 있으면: 가지, 이웃 2개가 강제 0, 남은 7자리 중 0 한 개 배치 씩 → 따라서 가지.
-
이면 이다. 2 두 개의 위치를 로 잡고 이어야 한다. 각 2의 이웃은 0으로 강제된다. 강제된 0의 개수를 이라 하면, 나머지 자유 자리 중 개의 0을 배치하므로 경우의 수는 이다.
- : 3쌍, 각 →
- : 18쌍, 각 →
- : 15쌍, 각 → 따라서 가지.
전체 경우의 수는
이다. 모든 배치를 직접 열거한 확인도 를 준다.
Comparative Analysis (Pprobability_30) (Average across runs)
Averages use reported measurements only. Missing usage is not treated as zero.