結果

問題 No.933 おまわりさんこいつです
ユーザー GrayCoderGrayCoder
提出日時 2019-11-29 22:43:42
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 598 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 82,572 KB
実行使用メモリ 98,632 KB
最終ジャッジ日時 2024-05-01 00:40:07
合計ジャッジ時間 7,608 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
62,792 KB
testcase_01 AC 42 ms
55,524 KB
testcase_02 AC 43 ms
55,068 KB
testcase_03 AC 43 ms
55,748 KB
testcase_04 AC 46 ms
55,984 KB
testcase_05 AC 42 ms
55,180 KB
testcase_06 AC 43 ms
55,712 KB
testcase_07 AC 44 ms
56,704 KB
testcase_08 AC 44 ms
54,800 KB
testcase_09 AC 43 ms
55,196 KB
testcase_10 AC 44 ms
56,012 KB
testcase_11 AC 48 ms
63,096 KB
testcase_12 AC 48 ms
62,396 KB
testcase_13 AC 57 ms
69,468 KB
testcase_14 AC 61 ms
72,616 KB
testcase_15 AC 95 ms
76,320 KB
testcase_16 AC 480 ms
79,560 KB
testcase_17 AC 80 ms
84,036 KB
testcase_18 AC 42 ms
55,664 KB
testcase_19 AC 106 ms
86,928 KB
testcase_20 AC 1,648 ms
85,536 KB
testcase_21 AC 42 ms
55,152 KB
testcase_22 AC 43 ms
55,172 KB
testcase_23 TLE -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import reduce
from operator import mul
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N = int(input())
    P = map(int, input().split())

    def func(n):
        d, ret = 1, 0
        while 1:
            while d > 0:
                d, m = divmod(n, 10)
                ret += m
                n = d
            if ret < 10:
                return ret
            d, n = 1, ret
            ret = 0

    p = [func(i) for i in P]
    k = reduce(mul, p)
    ans = 10
    while ans > 9:
        ans = func(k)
        k = ans
    print(ans)


main()
0