結果

問題 No.2699 Simple Math (Returned)
ユーザー YU Hirose
提出日時 2024-07-12 12:47:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 813 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 78,336 KB
最終ジャッジ日時 2024-07-12 12:47:56
合計ジャッジ時間 10,105 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
for _ in [0]*int(input()):
    n, m = map(int, input().split())
    n %= m * 2
    if n <= m:
        print((pow(10, n, mod) - 1) % mod)
    else:
        print((pow(10, m*2-n, mod) - 1) * pow(10, n-m, mod) % mod)
0