用户:QWERTY770/沙盒:修订间差异

添加741字节 、​ 2025年3月12日 (星期三)
无编辑摘要
(// Edit via Wikiplus)
无编辑摘要
 
第1行: 第1行:
测试字节数 111
<pre>from collections import Counter
 
a = [1]
s = 1
l = 1
n = 0
m = 0
 
 
def check():
    c = Counter(a)
    if c[1] >= 2 and c[2] >= 1 and c[3] >= 1 and c[4] >= 1 and c[5] >= 1:
        if s - 16 <= 7:
            return True
    return False
 
 
while l > 0:
    if check():
        n += 6 ** (13 - l)
        if n > m:
            print(a, l, n)
            m = n + 1000000
        while a[-1] == 6:
            a.pop()
            l -= 1
            s -= 6
        if l > 0:
            a[-1] += 1
            s += 1
        continue
    if l < 13:
        a.append(1)
        l += 1
        s += 1
    else:
        while a[-1] == 6:
            a.pop()
            l -= 1
            s -= 6
        if l > 0:
            a[-1] += 1
            s += 1
</pre>
3,040

个编辑