无故40分

P1618 三连击(升级版)

Polariserist @ 2023-09-22 12:19:48

我的python代码不知道为啥wa了3个点

ll = input()
l = ll.split()
a = [0 for i in range(5)]
b = [0 for i in range(5)]
c = [0 for i in range(5)]
valid = 0
if l[0] == '0' or l[1] == '0' or l[2] == '0':
    print('No!!!')
else:
    for i in range(123,333):
        if i % int(l[0]) != 0:
            continue
        aa = i / int(l[0])
        bb = i * int(l[1])
        cc = i * int(l[2])
        if cc >= 1000:
            continue
        a[3] = aa % 10
        aa = aa // 10
        a[2] = aa % 10
        aa = aa // 10
        a[1] = aa % 10
        b[3] = bb % 10
        bb = bb // 10
        b[2] = bb % 10
        bb = bb // 10
        b[1] = bb % 10
        c[3] = cc % 10
        cc = cc // 10
        c[2] = cc % 10
        cc = cc // 10
        c[1] = cc % 10
        if a[1] * a[2] * a[3] * b[1] * b[2] * b[3] * c[1] * c[2] * c[3] == 362880 and a[1] + a[2] + a[3] + b[1] + b[2] + b[3] + c[1] + c[2] + c[3] == 45:
            print(i , bb , cc)
            valid = 1
    if valid == 0:
        print('No!!!')

by Kasugano__Sora @ 2023-10-03 23:12:27

罕见的p用户


|