結果

問題 No.933 おまわりさんこいつです
ユーザー calei
提出日時 2020-01-07 23:34:36
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 22,004 KB
最終ジャッジ日時 2024-11-23 01:21:33
合計ジャッジ時間 3,371 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 12 RE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

# 2020/01/07
# 解説カンニング
# 数字根の性質を利用する
#  n==0のとき => 0
#  n%9==0のとき => 9
#  else => n%9

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

cnt=1
for e in p:
    tmp=e%9
    if tmp:
        cnt*=tmp
    else:
        if e:
            cnt*=9
        else:
            print(0)
            exit()
ans=0
for e in str(cnt):
    ans+=int(e)
print(ans)
0