結果

問題 No.1915 Addition
ユーザー GrayCoder
提出日時 2022-04-29 23:04:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 343 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-06-29 04:43:05
合計ジャッジ時間 1,700 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    T = int(input())
    for _ in [0] * T:
        N = input()
        m = 9 - (sum(map(int, N)) % 9)
        for i in range(17):
            ans = m * (10**i)
            if not int(N + str(ans)) % (int(N) + ans):
                break
        print(ans)


main()
0