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

添加580字节 、​ 2025年3月12日 (星期三)
无编辑摘要
(// Edit via Wikiplus)
无编辑摘要
 
(未显示2个用户的3个中间版本)
第1行: 第1行:
a{{IDE|25012|4}}b{{IDE|25011|4}}
<pre>from collections import Counter


c{{IsLeapYear|2020}}
a = [1]
d{{IsLeapYear|2021}}
s = 1
l = 1
n = 0
m = 0


{{DOY|2020}}{{DOY|2021}}


{{DOM|1}}{{DOM|9}}{{DOM|2}}{{DOM|2|2020}}
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


{{DFJ1|9|7|2020}}{{DFJ1|8|6|2021}}
 
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

个编辑