結果

問題 No.432 占い(Easy)
ユーザー adothadoth
提出日時 2017-11-12 10:52:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 462 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 10,816 KB
実行使用メモリ 12,668 KB
最終ジャッジ日時 2023-08-16 10:54:01
合計ジャッジ時間 2,380 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,936 KB
testcase_01 AC 16 ms
7,856 KB
testcase_02 AC 17 ms
7,844 KB
testcase_03 AC 16 ms
7,840 KB
testcase_04 AC 16 ms
7,776 KB
testcase_05 AC 15 ms
7,868 KB
testcase_06 AC 15 ms
7,780 KB
testcase_07 AC 15 ms
7,924 KB
testcase_08 AC 15 ms
7,772 KB
testcase_09 AC 20 ms
7,828 KB
testcase_10 AC 17 ms
7,880 KB
testcase_11 AC 22 ms
7,816 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 23 ms
7,780 KB
testcase_15 AC 15 ms
7,872 KB
testcase_16 AC 15 ms
7,956 KB
testcase_17 RE -
testcase_18 AC 65 ms
9,216 KB
testcase_19 AC 47 ms
8,548 KB
testcase_20 AC 28 ms
8,364 KB
testcase_21 AC 31 ms
8,616 KB
testcase_22 AC 17 ms
7,876 KB
testcase_23 AC 18 ms
7,932 KB
testcase_24 AC 20 ms
7,796 KB
testcase_25 AC 21 ms
7,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def over_ten(n):
    if n >= 10:
        return n // 10 + n % 10
    else:
        return n


def fortune_telling(S):
    if len(S) == 1:
        print(S[0])
    else:
        fortune_S = []
        for i in range(1, len(S)):
            fortune_S.append(over_ten(S[i-1] + S[i]))
        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