結果

問題 No.2699 Simple Math (Returned)
ユーザー tassei903tassei903
提出日時 2024-03-29 22:05:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 431 ms / 2,000 ms
コード長 549 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 78,356 KB
最終ジャッジ日時 2024-03-29 22:05:33
合計ジャッジ時間 5,859 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 163 ms
78,356 KB
testcase_02 AC 347 ms
76,284 KB
testcase_03 AC 155 ms
77,940 KB
testcase_04 AC 431 ms
76,440 KB
testcase_05 AC 299 ms
76,440 KB
testcase_06 AC 261 ms
76,696 KB
testcase_07 AC 376 ms
76,436 KB
testcase_08 AC 380 ms
76,436 KB
testcase_09 AC 385 ms
76,436 KB
testcase_10 AC 382 ms
76,440 KB
testcase_11 AC 382 ms
76,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################
mod = 998244353
for _ in range(ni()):
    n, m = na()
    n %= 2*m
    ans = 0
    if n < m:
        print((pow(10, n, mod)-1)%mod)
    else:
        print((pow(10, m, mod)-pow(10, n-m, mod))%mod)
0