結果

問題 No.933 おまわりさんこいつです
ユーザー FromBooska
提出日時 2024-03-12 13:46:09
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 561 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 82,508 KB
実行使用メモリ 93,348 KB
最終ジャッジ日時 2024-09-29 22:17:43
合計ジャッジ時間 5,055 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 RE * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

# たとえば12*23=(10+2)*(20+3)、桁和を求めるということは10は意味がなくなるので(1+2)*(2+3)となる
# つまり各数字の桁和の積でいいはず、式変形

N = int(input())
P = list(map(int, input().split()))

def digitsum(n):
    calc = 0
    for s in str(n):
        calc += int(s)
    return calc

#digitsum(12)

P2 = []
for p in P:
    P2.append(digitsum(p))

#print(P2)

product = 1
for p in P2:
    product *= p

#print(product)

current = product
while len(str(current))>1:
    current = digitsum(current)
print(current) 
0