結果

問題 No.432 占い(Easy)
ユーザー konabekonabe
提出日時 2018-07-09 21:53:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 372 bytes
コンパイル時間 129 ms
コンパイル使用メモリ 10,592 KB
実行使用メモリ 12,900 KB
最終ジャッジ日時 2023-09-23 04:16:43
合計ジャッジ時間 2,144 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,960 KB
testcase_01 AC 16 ms
7,968 KB
testcase_02 AC 17 ms
7,936 KB
testcase_03 AC 18 ms
8,064 KB
testcase_04 AC 19 ms
7,988 KB
testcase_05 AC 16 ms
8,096 KB
testcase_06 AC 17 ms
8,064 KB
testcase_07 AC 17 ms
7,952 KB
testcase_08 AC 16 ms
7,972 KB
testcase_09 AC 19 ms
7,908 KB
testcase_10 AC 18 ms
7,892 KB
testcase_11 AC 25 ms
7,932 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 24 ms
7,952 KB
testcase_15 AC 16 ms
8,052 KB
testcase_16 AC 16 ms
7,876 KB
testcase_17 RE -
testcase_18 AC 70 ms
9,404 KB
testcase_19 AC 49 ms
8,800 KB
testcase_20 AC 30 ms
8,552 KB
testcase_21 AC 33 ms
8,716 KB
testcase_22 AC 17 ms
7,984 KB
testcase_23 AC 19 ms
8,008 KB
testcase_24 AC 19 ms
7,992 KB
testcase_25 AC 19 ms
8,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def add(x, y):
    z = x + y
    if z >= 10:
        return z % 10 + z // 10
    else:
        return z

def shrink(x):
    if len(x) == 1:
        return x[0]
    else:
        r = [add(x[i], x[i+1]) for i in range(len(x)-1)]
        return shrink(r)

T = int(input())
S = [[int (j) for j in list(input())] for i in range(T)]
for s in S:
    print(shrink(s))
0