結果

問題 No.2699 Simple Math (Returned)
ユーザー sotanishysotanishy
提出日時 2024-03-29 21:32:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 392 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 76,612 KB
最終ジャッジ日時 2024-03-29 21:32:14
合計ジャッジ時間 5,347 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 116 ms
76,612 KB
testcase_02 AC 284 ms
75,844 KB
testcase_03 AC 113 ms
76,096 KB
testcase_04 AC 392 ms
75,896 KB
testcase_05 AC 252 ms
75,972 KB
testcase_06 AC 204 ms
75,972 KB
testcase_07 AC 352 ms
75,896 KB
testcase_08 AC 344 ms
76,000 KB
testcase_09 AC 342 ms
75,896 KB
testcase_10 AC 371 ms
75,896 KB
testcase_11 AC 342 ms
75,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.readline

mod = 998244353
T = int(input())
for _ in range(T):
    N, M = map(int, input().split())
    N %= 2 * M
    if N <= M:
        ans = (pow(10, N, mod) - 1) % mod
    else:
        ans = (pow(10, M, mod) - pow(10, N - M, mod)) % mod
    print(ans)
0