結果

問題 No.2699 Simple Math (Returned)
ユーザー 寝癖寝癖
提出日時 2024-03-29 21:36:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 785 ms / 2,000 ms
コード長 233 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 76,020 KB
最終ジャッジ日時 2024-03-29 21:36:31
合計ジャッジ時間 9,860 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,332 KB
testcase_01 AC 528 ms
76,016 KB
testcase_02 AC 679 ms
75,764 KB
testcase_03 AC 522 ms
75,764 KB
testcase_04 AC 785 ms
75,892 KB
testcase_05 AC 668 ms
76,020 KB
testcase_06 AC 605 ms
76,020 KB
testcase_07 AC 730 ms
75,892 KB
testcase_08 AC 760 ms
75,892 KB
testcase_09 AC 744 ms
76,020 KB
testcase_10 AC 751 ms
76,020 KB
testcase_11 AC 774 ms
76,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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