結果

問題 No.432 占い(Easy)
ユーザー shiccocsan
提出日時 2016-12-02 08:47:52
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 301 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-27 17:09:22
合計ジャッジ時間 2,445 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(a, b):
    c = a + b
    if c >= 10:
        return 1 + (c % 10)
    else:
        return c

t = int(input())
for i in range(t):
    s = list(map(int, ''.join(input())))
    while len(s) > 1:
        for j in range(len(s) - 1):
            s[j] = f(s[j], s[j + 1])
        s.pop()
    print(*s)
0