結果

問題 No.933 おまわりさんこいつです
ユーザー FromBooskaFromBooska
提出日時 2024-03-12 13:46:09
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 561 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 92,748 KB
最終ジャッジ日時 2024-03-12 13:46:16
合計ジャッジ時間 6,400 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,460 KB
testcase_01 AC 32 ms
53,460 KB
testcase_02 AC 32 ms
53,460 KB
testcase_03 AC 32 ms
53,460 KB
testcase_04 AC 33 ms
53,460 KB
testcase_05 AC 34 ms
53,460 KB
testcase_06 AC 33 ms
53,460 KB
testcase_07 AC 33 ms
53,460 KB
testcase_08 AC 33 ms
53,460 KB
testcase_09 AC 34 ms
53,456 KB
testcase_10 AC 34 ms
53,460 KB
testcase_11 AC 38 ms
59,456 KB
testcase_12 AC 39 ms
59,448 KB
testcase_13 AC 47 ms
70,604 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 75 ms
85,644 KB
testcase_18 AC 32 ms
53,460 KB
testcase_19 AC 102 ms
89,080 KB
testcase_20 RE -
testcase_21 AC 32 ms
53,460 KB
testcase_22 AC 32 ms
53,460 KB
testcase_23 RE -
testcase_24 RE -
権限があれば一括ダウンロードができます

ソースコード

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