結果

問題 No.432 占い(Easy)
ユーザー motor_radialmotor_radial
提出日時 2019-08-15 11:55:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 370 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 11,784 KB
実行使用メモリ 10,076 KB
最終ジャッジ日時 2023-10-19 18:48:57
合計ジャッジ時間 3,882 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,052 KB
testcase_01 AC 30 ms
10,052 KB
testcase_02 AC 30 ms
10,052 KB
testcase_03 AC 32 ms
10,052 KB
testcase_04 AC 36 ms
10,052 KB
testcase_05 AC 30 ms
10,052 KB
testcase_06 AC 30 ms
10,052 KB
testcase_07 AC 34 ms
10,052 KB
testcase_08 AC 30 ms
10,052 KB
testcase_09 AC 33 ms
10,076 KB
testcase_10 AC 36 ms
10,052 KB
testcase_11 AC 62 ms
10,052 KB
testcase_12 AC 370 ms
10,060 KB
testcase_13 AC 359 ms
10,060 KB
testcase_14 AC 63 ms
10,052 KB
testcase_15 AC 30 ms
10,052 KB
testcase_16 AC 29 ms
10,052 KB
testcase_17 AC 302 ms
10,060 KB
testcase_18 AC 192 ms
10,060 KB
testcase_19 AC 133 ms
10,060 KB
testcase_20 AC 76 ms
10,056 KB
testcase_21 AC 85 ms
10,060 KB
testcase_22 AC 33 ms
10,052 KB
testcase_23 AC 32 ms
10,052 KB
testcase_24 AC 32 ms
10,076 KB
testcase_25 AC 32 ms
10,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
out=[]
for x in range(T):
    S=input()
    K=len(S)
    if(len(S)==1):
        out.extend(S)
    else:
        while(K>1):
            ans=[0]*(K-1)
            for i in range(K-1):
                ans[i]=int(S[i])+int(S[i+1])
                if ans[i]>=10:
                    ans[i]=ans[i]//10+ans[i]%10
            S=ans
            K-=1
        out.extend(str(ans[0]))
for k in out:
    print(k)
0