結果

問題 No.432 占い(Easy)
ユーザー convexineqconvexineq
提出日時 2021-04-04 10:09:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 243 bytes
コンパイル時間 550 ms
コンパイル使用メモリ 87,352 KB
実行使用メモリ 76,764 KB
最終ジャッジ日時 2023-08-27 05:47:30
合計ジャッジ時間 3,650 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,260 KB
testcase_01 AC 69 ms
71,280 KB
testcase_02 AC 70 ms
71,156 KB
testcase_03 AC 72 ms
71,144 KB
testcase_04 AC 76 ms
75,700 KB
testcase_05 AC 70 ms
71,368 KB
testcase_06 AC 72 ms
71,432 KB
testcase_07 AC 73 ms
75,708 KB
testcase_08 AC 72 ms
71,304 KB
testcase_09 AC 95 ms
76,764 KB
testcase_10 AC 79 ms
76,256 KB
testcase_11 AC 77 ms
75,632 KB
testcase_12 AC 85 ms
76,124 KB
testcase_13 AC 86 ms
76,212 KB
testcase_14 AC 75 ms
75,804 KB
testcase_15 AC 69 ms
71,412 KB
testcase_16 AC 72 ms
71,528 KB
testcase_17 AC 71 ms
71,268 KB
testcase_18 AC 84 ms
76,108 KB
testcase_19 AC 79 ms
75,680 KB
testcase_20 AC 76 ms
75,592 KB
testcase_21 AC 75 ms
75,712 KB
testcase_22 AC 80 ms
76,148 KB
testcase_23 AC 87 ms
76,348 KB
testcase_24 AC 94 ms
76,764 KB
testcase_25 AC 97 ms
76,456 KB
権限があれば一括ダウンロードができます

ソースコード

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