結果

問題 No.432 占い(Easy)
ユーザー adothadoth
提出日時 2017-11-12 15:40:07
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
RE  
実行時間 -
コード長 455 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 12,756 KB
最終ジャッジ日時 2023-08-16 10:56:47
合計ジャッジ時間 2,516 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,924 KB
testcase_01 AC 15 ms
7,908 KB
testcase_02 AC 16 ms
7,824 KB
testcase_03 AC 15 ms
7,912 KB
testcase_04 AC 16 ms
7,912 KB
testcase_05 AC 15 ms
7,824 KB
testcase_06 AC 16 ms
7,924 KB
testcase_07 AC 16 ms
7,844 KB
testcase_08 AC 16 ms
7,980 KB
testcase_09 AC 21 ms
7,824 KB
testcase_10 AC 17 ms
7,844 KB
testcase_11 AC 21 ms
7,896 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 22 ms
7,780 KB
testcase_15 AC 15 ms
7,948 KB
testcase_16 AC 16 ms
7,820 KB
testcase_17 RE -
testcase_18 AC 46 ms
9,380 KB
testcase_19 AC 36 ms
8,676 KB
testcase_20 AC 25 ms
8,420 KB
testcase_21 AC 26 ms
8,584 KB
testcase_22 AC 17 ms
7,840 KB
testcase_23 AC 19 ms
7,920 KB
testcase_24 AC 21 ms
7,868 KB
testcase_25 AC 22 ms
7,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 3)


def fortune_telling(S):
    if len(S) == 1:
        return print(S.pop())
    else:
        fortune_S = []
        for i in range(1, len(S)):
            plus = S[i-1] + S[i]
            fortune_S.append(plus // 10 + plus % 10)
        fortune_telling(fortune_S)


def main():
    n = int(input())
    for _ in range(n):
        S = list(map(int, " ".join(input()).split()))
        fortune_telling(S)


main()
0