結果

問題 No.933 おまわりさんこいつです
ユーザー GrayCoderGrayCoder
提出日時 2019-11-29 22:33:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 486 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 10,916 KB
実行使用メモリ 16,904 KB
最終ジャッジ日時 2023-08-13 06:43:01
合計ジャッジ時間 9,328 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,568 KB
testcase_01 AC 20 ms
8,728 KB
testcase_02 AC 19 ms
8,700 KB
testcase_03 AC 20 ms
8,588 KB
testcase_04 AC 19 ms
8,684 KB
testcase_05 AC 20 ms
8,620 KB
testcase_06 AC 20 ms
8,528 KB
testcase_07 AC 19 ms
8,596 KB
testcase_08 AC 20 ms
8,736 KB
testcase_09 AC 20 ms
8,616 KB
testcase_10 AC 20 ms
8,676 KB
testcase_11 AC 20 ms
8,580 KB
testcase_12 AC 21 ms
8,628 KB
testcase_13 AC 38 ms
8,796 KB
testcase_14 AC 54 ms
8,988 KB
testcase_15 AC 169 ms
9,476 KB
testcase_16 AC 1,587 ms
11,308 KB
testcase_17 AC 95 ms
15,176 KB
testcase_18 AC 19 ms
8,636 KB
testcase_19 AC 136 ms
16,904 KB
testcase_20 AC 1,572 ms
10,424 KB
testcase_21 AC 20 ms
8,728 KB
testcase_22 AC 20 ms
8,596 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):
        ret, d = 0, 1
        while d > 0:
            d, m = divmod(n, 10)
            ret += m
            n = d
        return ret

    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