結果

問題 No.2699 Simple Math (Returned)
ユーザー 👑 rin204rin204
提出日時 2024-03-29 23:33:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 827 ms / 2,000 ms
コード長 199 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 76,144 KB
最終ジャッジ日時 2024-03-29 23:33:26
合計ジャッジ時間 9,628 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,332 KB
testcase_01 AC 524 ms
75,764 KB
testcase_02 AC 700 ms
75,888 KB
testcase_03 AC 491 ms
75,764 KB
testcase_04 AC 827 ms
76,144 KB
testcase_05 AC 640 ms
75,884 KB
testcase_06 AC 648 ms
75,888 KB
testcase_07 AC 760 ms
76,140 KB
testcase_08 AC 731 ms
76,140 KB
testcase_09 AC 721 ms
76,012 KB
testcase_10 AC 729 ms
76,012 KB
testcase_11 AC 741 ms
76,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353
for _ in range(int(input())):
    n, m = map(int, input().split())
    n %= 2 * m
    x = max(0, n - m)
    ans = pow(10, x, MOD) * (pow(10, n - 2 * x, MOD) - 1) % MOD
    print(ans)
0