結果

問題 No.2699 Simple Math (Returned)
ユーザー KudeKude
提出日時 2024-03-29 21:10:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 813 ms / 2,000 ms
コード長 248 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,016 KB
最終ジャッジ日時 2024-03-29 21:10:49
合計ジャッジ時間 9,870 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,332 KB
testcase_01 AC 506 ms
76,012 KB
testcase_02 AC 720 ms
75,888 KB
testcase_03 AC 513 ms
75,756 KB
testcase_04 AC 813 ms
75,888 KB
testcase_05 AC 692 ms
76,016 KB
testcase_06 AC 611 ms
76,016 KB
testcase_07 AC 770 ms
75,888 KB
testcase_08 AC 769 ms
75,888 KB
testcase_09 AC 768 ms
76,016 KB
testcase_10 AC 772 ms
76,016 KB
testcase_11 AC 752 ms
76,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
for _ in range(int(input())):
    n, m = map(int, input().split())
    q, r = divmod(n, m)
    if q % 2 == 0:
        ans = (pow(10, r, mod) - 1) % mod
    else:
        ans = (pow(10, m, mod) - pow(10, r, mod)) % mod
    print(ans)
0