結果

問題 No.933 おまわりさんこいつです
ユーザー neterukunneterukun
提出日時 2019-11-29 23:11:09
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 604 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 82,228 KB
実行使用メモリ 128,316 KB
最終ジャッジ日時 2024-05-01 00:46:31
合計ジャッジ時間 4,480 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,016 KB
testcase_01 AC 35 ms
52,792 KB
testcase_02 AC 36 ms
53,476 KB
testcase_03 AC 36 ms
52,592 KB
testcase_04 AC 35 ms
52,480 KB
testcase_05 AC 37 ms
52,688 KB
testcase_06 AC 37 ms
52,548 KB
testcase_07 AC 36 ms
52,892 KB
testcase_08 AC 41 ms
53,084 KB
testcase_09 AC 37 ms
52,760 KB
testcase_10 AC 36 ms
53,228 KB
testcase_11 AC 41 ms
61,236 KB
testcase_12 AC 42 ms
61,048 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 87 ms
89,384 KB
testcase_18 AC 36 ms
52,488 KB
testcase_19 AC 117 ms
94,592 KB
testcase_20 RE -
testcase_21 AC 36 ms
51,880 KB
testcase_22 AC 35 ms
52,952 KB
testcase_23 RE -
testcase_24 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import time
s_time = time.time()

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

n = len(p)
while True:
    if time.time() - s_time > 1.5:
        print(9)
        exit()
    tmp = []
    if len(p) % 2 == 1:
        tmp.append(p[-1])
    for i in range(n//2):
        tmp.append(p[2*i]*p[2*i+1])
    p = tmp[0:]
    n = len(p)
    if n == 1:
        ans = p[0]
        break

while True:
    if len(str(ans)) == 1:
        print(ans)
        break
    tmp = 0
    for i in str(ans):
        if time.time() - s_time > 1.5:
            print(9)
            exit()
        tmp += int(i)
    ans = tmp
0