結果

問題 No.933 おまわりさんこいつです
ユーザー hedwig100hedwig100
提出日時 2020-04-09 12:28:55
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 546 bytes
コンパイル時間 1,534 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 78,152 KB
最終ジャッジ日時 2023-10-01 03:09:06
合計ジャッジ時間 11,826 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,180 KB
testcase_01 AC 88 ms
75,816 KB
testcase_02 AC 98 ms
76,340 KB
testcase_03 AC 118 ms
76,128 KB
testcase_04 AC 123 ms
76,084 KB
testcase_05 AC 162 ms
76,176 KB
testcase_06 AC 207 ms
75,952 KB
testcase_07 AC 240 ms
76,116 KB
testcase_08 AC 300 ms
76,016 KB
testcase_09 AC 427 ms
76,044 KB
testcase_10 AC 433 ms
76,040 KB
testcase_11 AC 1,144 ms
76,636 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7
INF = 10 ** 10
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)

def digitsum(n):
    ans = 0
    power = 10
    for _ in range(int(n//10) + 1):
        ans += n%power
        n //= power
        power *= 10
    return ans

def main():
    n = int(input())
    p = [digitsum(int(i)) for i in input().split()]

    ans = 1
    for pi in p:
        ans *= pi
        while ans//10 > 0:
            ans = digitsum(ans)
    
    print(ans)
if __name__ =='__main__':
    main()  
0