結果

問題 No.432 占い(Easy)
ユーザー kohei2019kohei2019
提出日時 2022-01-24 23:58:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 215 ms / 2,000 ms
コード長 440 bytes
コンパイル時間 428 ms
コンパイル使用メモリ 86,712 KB
実行使用メモリ 77,880 KB
最終ジャッジ日時 2023-08-21 15:15:22
合計ジャッジ時間 4,789 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,108 KB
testcase_01 AC 70 ms
70,808 KB
testcase_02 AC 75 ms
71,120 KB
testcase_03 AC 73 ms
71,192 KB
testcase_04 AC 89 ms
76,284 KB
testcase_05 AC 73 ms
71,080 KB
testcase_06 AC 72 ms
71,080 KB
testcase_07 AC 95 ms
76,420 KB
testcase_08 AC 73 ms
71,064 KB
testcase_09 AC 91 ms
76,348 KB
testcase_10 AC 99 ms
76,476 KB
testcase_11 AC 114 ms
77,440 KB
testcase_12 AC 210 ms
77,536 KB
testcase_13 AC 215 ms
77,444 KB
testcase_14 AC 111 ms
77,564 KB
testcase_15 AC 73 ms
71,288 KB
testcase_16 AC 72 ms
71,312 KB
testcase_17 AC 197 ms
77,332 KB
testcase_18 AC 161 ms
76,988 KB
testcase_19 AC 141 ms
77,220 KB
testcase_20 AC 119 ms
77,880 KB
testcase_21 AC 122 ms
77,192 KB
testcase_22 AC 94 ms
76,560 KB
testcase_23 AC 95 ms
76,796 KB
testcase_24 AC 91 ms
76,448 KB
testcase_25 AC 91 ms
76,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
def ff(i):
    i = sum(list(map(int,list(str(i)))))
    while len(str(i)) > 1:
        i = sum(list(map(int,list(str(i)))))
    return i
def func(num):
    ll = list(map(int,list(str(num))))
    N = len(ll)
    for i in range(N-1):
        ll1 = []
        for j in range(N-i-1):
            ll1.append(ff(ll[j]+ll[j+1]))
        ll = ll1
    return ll[0]
lsS = [input() for i in range(T)]
for s in lsS:
    print(func(s))
0