結果

問題 No.2699 Simple Math (Returned)
ユーザー aa
提出日時 2024-03-29 22:00:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 349 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 77,016 KB
最終ジャッジ日時 2024-03-29 22:00:15
合計ジャッジ時間 9,807 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 521 ms
76,140 KB
testcase_02 AC 735 ms
76,864 KB
testcase_03 AC 518 ms
75,880 KB
testcase_04 WA -
testcase_05 AC 705 ms
77,016 KB
testcase_06 AC 630 ms
76,120 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def fast_exponentiation(a, b, n):
    result = 1
    a %= n
    while b > 0:
        if b % 2 == 1:
            result = (result * a) % n
        a = (a * a) % n
        b //= 2
    return result
for _ in range(int(input())):
	n,m=map(int,input().split())
	s=fast_exponentiation(10,n%(2*m),998244353)
	if s==0:
		print(998244352)
	else:
		print(s-1)
0