結果

問題 No.933 おまわりさんこいつです
ユーザー はむ吉🐹はむ吉🐹
提出日時 2019-11-29 21:53:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 10,544 KB
実行使用メモリ 22,148 KB
最終ジャッジ日時 2023-08-13 05:19:20
合計ジャッジ時間 1,996 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,580 KB
testcase_01 AC 20 ms
8,560 KB
testcase_02 AC 20 ms
8,508 KB
testcase_03 AC 20 ms
8,592 KB
testcase_04 AC 19 ms
8,664 KB
testcase_05 AC 20 ms
8,632 KB
testcase_06 AC 20 ms
8,580 KB
testcase_07 AC 20 ms
8,556 KB
testcase_08 AC 20 ms
8,556 KB
testcase_09 AC 20 ms
8,696 KB
testcase_10 AC 20 ms
8,552 KB
testcase_11 AC 19 ms
8,688 KB
testcase_12 AC 20 ms
8,612 KB
testcase_13 AC 21 ms
8,920 KB
testcase_14 AC 22 ms
9,052 KB
testcase_15 AC 24 ms
9,748 KB
testcase_16 AC 34 ms
11,948 KB
testcase_17 AC 51 ms
17,580 KB
testcase_18 AC 20 ms
8,576 KB
testcase_19 AC 60 ms
19,952 KB
testcase_20 AC 51 ms
10,444 KB
testcase_21 AC 19 ms
8,596 KB
testcase_22 AC 20 ms
8,592 KB
testcase_23 AC 73 ms
22,148 KB
testcase_24 AC 73 ms
21,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

import functools


def compute(ps):
    m = functools.reduce(lambda x, y: x * y % 9, ps) % 9
    return 9 if m == 0 and all(p != 0 for p in ps) else m


def main():
    _ = int(input())
    ps = [int(p) for p in input().split()]
    c = compute(ps)
    print(c)


if __name__ == "__main__":
    main()
0