結果

問題 No.432 占い(Easy)
ユーザー convexineq
提出日時 2021-04-04 10:09:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 243 bytes
コンパイル時間 490 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 74,820 KB
最終ジャッジ日時 2024-12-26 15:28:33
合計ジャッジ時間 2,687 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for _ in range(T):
    *s, = map(int,input())
    if all(si==0 for si in s):
        print(0)
        continue
    for _ in range(len(s)-1):
        s = [(i+j)%9 for i,j in zip(s,s[1:])]
    v = s[0]%9
    print(v if v else 9)
0