結果

問題 No.933 おまわりさんこいつです
ユーザー uni_pythonuni_python
提出日時 2020-10-15 23:18:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 92,336 KB
最終ジャッジ日時 2023-09-28 01:29:21
合計ジャッジ時間 4,285 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,168 KB
testcase_01 AC 73 ms
71,056 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 75 ms
71,188 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 81 ms
76,520 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 74 ms
71,224 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 75 ms
71,196 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 105 ms
91,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    P=LI()
    
    def ch(x):
        if x==0:
            return 0
        res=x%9
        if res==0:
            res=9
        return res
        
    
    ans=0
    for i in range(N):
        P[i]=ch(P[i])
        ans+=P[i]
        
    while ans>=10:
        ans=ch(ans)
        
    print(ans)




main()
0