結果

問題 No.432 占い(Easy)
ユーザー utsumidaisukeutsumidaisuke
提出日時 2018-12-18 15:52:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 353 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 11,860 KB
実行使用メモリ 10,148 KB
最終ジャッジ日時 2023-10-25 23:38:50
合計ジャッジ時間 3,666 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,120 KB
testcase_01 RE -
testcase_02 AC 34 ms
10,120 KB
testcase_03 AC 28 ms
10,120 KB
testcase_04 AC 32 ms
10,120 KB
testcase_05 AC 28 ms
10,120 KB
testcase_06 RE -
testcase_07 AC 32 ms
10,120 KB
testcase_08 AC 28 ms
10,120 KB
testcase_09 RE -
testcase_10 AC 33 ms
10,124 KB
testcase_11 AC 70 ms
10,120 KB
testcase_12 AC 432 ms
10,148 KB
testcase_13 AC 421 ms
10,148 KB
testcase_14 AC 68 ms
10,120 KB
testcase_15 AC 29 ms
10,120 KB
testcase_16 AC 29 ms
10,120 KB
testcase_17 AC 345 ms
10,148 KB
testcase_18 AC 222 ms
10,148 KB
testcase_19 AC 155 ms
10,132 KB
testcase_20 AC 86 ms
10,120 KB
testcase_21 AC 95 ms
10,124 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 RE -
testcase_25 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

def sum(x,y):
    if int(x) + int(y) < 10:
        return int(x)+int(y)
    else:
        return (int(x)+int(y))//10 + (int(x)+int(y))%10

n = int(input())
for i in range(n):
    num = list(input())

    while len(num) > 1:
        ls= []
        for i in range(len(num)-1):
            ls.append(sum(num[i], num[i+1]))
        num = ls
    print(ls[0])
0