結果

問題 No.933 おまわりさんこいつです
ユーザー MineMine
提出日時 2020-09-09 14:29:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 372 ms / 2,000 ms
コード長 227 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 10,440 KB
実行使用メモリ 21,648 KB
最終ジャッジ日時 2023-08-21 16:22:44
合計ジャッジ時間 4,070 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,836 KB
testcase_01 AC 16 ms
7,836 KB
testcase_02 AC 16 ms
7,800 KB
testcase_03 AC 16 ms
7,784 KB
testcase_04 AC 16 ms
7,832 KB
testcase_05 AC 16 ms
7,796 KB
testcase_06 AC 16 ms
7,832 KB
testcase_07 AC 17 ms
7,680 KB
testcase_08 AC 15 ms
7,736 KB
testcase_09 AC 16 ms
7,832 KB
testcase_10 AC 17 ms
7,912 KB
testcase_11 AC 16 ms
7,812 KB
testcase_12 AC 17 ms
7,896 KB
testcase_13 AC 22 ms
8,120 KB
testcase_14 AC 24 ms
8,552 KB
testcase_15 AC 34 ms
9,148 KB
testcase_16 AC 74 ms
11,532 KB
testcase_17 AC 46 ms
17,084 KB
testcase_18 AC 16 ms
8,120 KB
testcase_19 AC 67 ms
19,404 KB
testcase_20 AC 120 ms
9,956 KB
testcase_21 AC 15 ms
7,836 KB
testcase_22 AC 16 ms
7,816 KB
testcase_23 AC 372 ms
21,648 KB
testcase_24 AC 370 ms
21,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
p = list(map(int, input().split()))

k = 1
for i in range(n):
    ps = sum(map(int, str(p[i])))
    if ps == 0:
        print(0)
        exit()
    k *= ps
    k %= 9

if k == 0:
    print(9)
else:
    print(k)
0