結果

問題 No.933 おまわりさんこいつです
ユーザー Azumabashi
提出日時 2020-05-02 13:38:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 428 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 382 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 20,496 KB
最終ジャッジ日時 2024-12-29 21:28:00
合計ジャッジ時間 3,367 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10**6)


def get_digit_sum(n):
    if n < 10:
        return n
    else:
        return get_digit_sum(n % 10 + n // 10)


def main():
    length = int(input())
    sequence = [get_digit_sum(int(x)) for x in input().split()]
    product = 1
    for seq in sequence:
        product = get_digit_sum(product * seq)
    print(get_digit_sum(product))


if __name__ == '__main__':
    main()

0