結果

問題 No.933 おまわりさんこいつです
ユーザー FromBooskaFromBooska
提出日時 2023-03-09 13:47:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 749 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 81,576 KB
実行使用メモリ 92,500 KB
最終ジャッジ日時 2023-10-18 06:17:11
合計ジャッジ時間 3,918 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,352 KB
testcase_01 AC 38 ms
53,352 KB
testcase_02 AC 38 ms
53,352 KB
testcase_03 AC 38 ms
53,352 KB
testcase_04 AC 39 ms
53,352 KB
testcase_05 AC 38 ms
53,352 KB
testcase_06 AC 39 ms
53,352 KB
testcase_07 AC 39 ms
53,352 KB
testcase_08 AC 38 ms
53,352 KB
testcase_09 AC 44 ms
59,768 KB
testcase_10 AC 42 ms
59,352 KB
testcase_11 AC 51 ms
62,012 KB
testcase_12 AC 53 ms
64,068 KB
testcase_13 AC 56 ms
68,252 KB
testcase_14 AC 57 ms
70,296 KB
testcase_15 AC 66 ms
75,420 KB
testcase_16 AC 78 ms
78,516 KB
testcase_17 AC 97 ms
85,412 KB
testcase_18 AC 38 ms
53,352 KB
testcase_19 AC 104 ms
88,904 KB
testcase_20 AC 88 ms
87,816 KB
testcase_21 AC 37 ms
53,352 KB
testcase_22 AC 37 ms
53,352 KB
testcase_23 AC 170 ms
92,496 KB
testcase_24 AC 180 ms
92,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 入力例2の言葉はいけない
# 難しいのは最初の掛け算だけ、あとは簡単
# 解き方が思いつかないので実験してみた
# かける数字同士の各桁をかけた和を使えばいいか

N = int(input())
P = list(map(int, input().split()))
product = P[0]

for i in range(1, N):
    list1 = []
    for p1 in str(product):
        list1.append(int(p1))
    list2 = []
    for p2 in str(P[i]):
        list2.append(int(p2))
    product = 0
    for p1 in list1:
        for p2 in list2:
            product += p1*p2
#print(product)

while True:
    temp = 0
    for s in str(product):
        temp += int(s)
    #print(temp)
    if len(str(temp)) == 1:
        break
    else:
        product = temp
    
print(temp)
0