結果

問題 No.432 占い(Easy)
ユーザー ああいいああいい
提出日時 2022-05-17 11:59:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 76,796 KB
最終ジャッジ日時 2023-10-13 09:02:24
合計ジャッジ時間 3,654 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,592 KB
testcase_01 AC 71 ms
71,452 KB
testcase_02 AC 72 ms
71,676 KB
testcase_03 AC 73 ms
71,392 KB
testcase_04 AC 77 ms
75,712 KB
testcase_05 AC 72 ms
71,468 KB
testcase_06 AC 75 ms
71,484 KB
testcase_07 AC 78 ms
76,040 KB
testcase_08 AC 75 ms
71,264 KB
testcase_09 AC 94 ms
76,520 KB
testcase_10 AC 81 ms
76,356 KB
testcase_11 AC 81 ms
76,344 KB
testcase_12 AC 85 ms
76,472 KB
testcase_13 AC 86 ms
76,348 KB
testcase_14 AC 81 ms
76,440 KB
testcase_15 AC 73 ms
71,528 KB
testcase_16 AC 73 ms
71,308 KB
testcase_17 AC 79 ms
76,140 KB
testcase_18 AC 87 ms
76,460 KB
testcase_19 AC 86 ms
76,452 KB
testcase_20 AC 80 ms
76,356 KB
testcase_21 AC 80 ms
76,396 KB
testcase_22 AC 84 ms
76,416 KB
testcase_23 AC 84 ms
76,084 KB
testcase_24 AC 95 ms
76,448 KB
testcase_25 AC 93 ms
76,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())

def calc(S):
    l = list(map(int,list(S)))
    while len(l) > 1:
        nx = [0] * (len(l) - 1)
        for i in range(len(l) - 1):
            nx[i] = l[i] + l[i+1]
            if nx[i] >= 10:
                nx[i] = nx[i] % 10 + nx[i] // 10
        l = nx
    return l[0]
for _ in range(T):
    print(calc(input()))
0