結果

問題 No.432 占い(Easy)
ユーザー adoth
提出日時 2017-11-12 15:42:54
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 494 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 14,848 KB
最終ジャッジ日時 2024-11-24 23:14:09
合計ジャッジ時間 1,905 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

# https://yukicoder.me/problems/no/432


import sys

sys.setrecursionlimit(10000)


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