結果

問題 No.933 おまわりさんこいつです
ユーザー kkyokkyo
提出日時 2020-05-05 18:37:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 339 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 10,520 KB
実行使用メモリ 21,596 KB
最終ジャッジ日時 2023-09-09 07:02:17
合計ジャッジ時間 1,852 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,840 KB
testcase_01 AC 16 ms
7,776 KB
testcase_02 AC 16 ms
7,804 KB
testcase_03 AC 16 ms
7,880 KB
testcase_04 AC 16 ms
7,872 KB
testcase_05 AC 15 ms
7,828 KB
testcase_06 AC 15 ms
7,828 KB
testcase_07 AC 15 ms
7,884 KB
testcase_08 AC 15 ms
7,784 KB
testcase_09 AC 15 ms
7,792 KB
testcase_10 AC 15 ms
7,736 KB
testcase_11 AC 15 ms
7,840 KB
testcase_12 AC 15 ms
7,788 KB
testcase_13 AC 17 ms
8,212 KB
testcase_14 AC 18 ms
8,608 KB
testcase_15 AC 23 ms
9,080 KB
testcase_16 AC 37 ms
11,512 KB
testcase_17 AC 42 ms
17,104 KB
testcase_18 AC 15 ms
7,768 KB
testcase_19 AC 52 ms
19,608 KB
testcase_20 AC 65 ms
9,928 KB
testcase_21 AC 15 ms
7,788 KB
testcase_22 AC 16 ms
7,740 KB
testcase_23 AC 88 ms
21,548 KB
testcase_24 AC 80 ms
21,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 数字根 = N mod 9 (ただし、0以外の9の倍数の場合は9)

N = int(input())
P = [int(s) for s in input().split()]

ans = 1
for p in P:
    if p == 0:
        ans *= 0
        break
    elif p % 9 > 0:
        ans *= p % 9
    else:
        ans *= 9

    if ans % 9 == 0:
        ans = 9
    else:
        ans %= 9


print(ans)
0