結果

問題 No.1168 Digit Sum Sequence
ユーザー otsunekootsuneko
提出日時 2021-05-14 13:54:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 35 ms / 2,000 ms
コード長 193 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 82,376 KB
実行使用メモリ 53,564 KB
最終ジャッジ日時 2024-04-09 19:03:35
合計ジャッジ時間 2,183 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
52,152 KB
testcase_01 AC 30 ms
53,564 KB
testcase_02 AC 29 ms
52,556 KB
testcase_03 AC 32 ms
53,068 KB
testcase_04 AC 33 ms
52,352 KB
testcase_05 AC 30 ms
52,316 KB
testcase_06 AC 30 ms
52,316 KB
testcase_07 AC 29 ms
52,000 KB
testcase_08 AC 32 ms
52,196 KB
testcase_09 AC 32 ms
52,872 KB
testcase_10 AC 35 ms
52,764 KB
testcase_11 AC 33 ms
53,008 KB
testcase_12 AC 34 ms
52,336 KB
testcase_13 AC 34 ms
53,500 KB
testcase_14 AC 33 ms
52,128 KB
testcase_15 AC 32 ms
52,884 KB
testcase_16 AC 32 ms
53,132 KB
testcase_17 AC 31 ms
52,772 KB
testcase_18 AC 32 ms
52,272 KB
testcase_19 AC 32 ms
52,280 KB
testcase_20 AC 30 ms
52,560 KB
testcase_21 AC 31 ms
52,336 KB
testcase_22 AC 32 ms
52,072 KB
testcase_23 AC 33 ms
52,552 KB
testcase_24 AC 33 ms
53,140 KB
testcase_25 AC 33 ms
51,880 KB
testcase_26 AC 33 ms
53,216 KB
testcase_27 AC 32 ms
52,116 KB
testcase_28 AC 33 ms
51,992 KB
testcase_29 AC 32 ms
52,548 KB
testcase_30 AC 33 ms
52,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def digsum(n):
    res = 0
    while n > 0:
        res += n%10
        n //= 10
    
    return res

N = int(input())

ans = N
for i in range(99):
    ans = digsum(ans)
print(ans)
0