結果

問題 No.2784 繰り上がりなし十進和
ユーザー ra5anchor
提出日時 2024-06-14 21:53:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 788 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 81,848 KB
実行使用メモリ 54,096 KB
最終ジャッジ日時 2024-06-14 21:53:32
合計ジャッジ時間 2,648 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

S = []
for i in range(6):
    s = input()
    S.append(s)

cnts = [0]*6

def solve(st):
    stnew = st
    while True:
        found = False
        m = len(st)
        l = list(st)
        for i in range(m):
            for j in range(m):
                x1 = l[i]
                x2 = l[j]
                x = (x1 + x2) % 10
                if x not in stnew:
                    found = True
                    stnew.add(x)
                    break
            if found == True:
                break
        if found == False:
            return len(stnew)
    return 0

for i in range(6):
    # i桁目
    st = set()
    for j in range(6):
        st.add(int(S[j][i]))
    # print(st)
    cnts[i] = solve(st)
ans = 1
for i in range(6):
    ans *= cnts[i]
print(ans)
# print(cnts)
0