結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,132 KB
testcase_01 AC 27 ms
10,132 KB
testcase_02 AC 27 ms
10,132 KB
testcase_03 AC 30 ms
10,132 KB
testcase_04 AC 37 ms
10,132 KB
testcase_05 AC 30 ms
10,132 KB
testcase_06 AC 28 ms
10,136 KB
testcase_07 AC 34 ms
10,132 KB
testcase_08 AC 30 ms
10,132 KB
testcase_09 AC 32 ms
10,136 KB
testcase_10 AC 33 ms
10,136 KB
testcase_11 AC 65 ms
10,132 KB
testcase_12 AC 420 ms
10,164 KB
testcase_13 AC 422 ms
10,164 KB
testcase_14 AC 67 ms
10,132 KB
testcase_15 AC 27 ms
10,132 KB
testcase_16 AC 28 ms
10,132 KB
testcase_17 AC 352 ms
10,164 KB
testcase_18 AC 222 ms
10,172 KB
testcase_19 AC 153 ms
10,140 KB
testcase_20 AC 85 ms
10,132 KB
testcase_21 AC 93 ms
10,132 KB
testcase_22 AC 32 ms
10,136 KB
testcase_23 AC 30 ms
10,136 KB
testcase_24 AC 31 ms
10,136 KB
testcase_25 AC 32 ms
10,136 KB
権限があれば一括ダウンロードができます

ソースコード

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())
    if len(num) == 1:
        print(num[0])
    else:
        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