結果
問題 |
No.2699 Simple Math (Returned)
|
ユーザー |
|
提出日時 | 2024-05-01 18:28:15 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 805 ms / 2,000 ms |
コード長 | 272 bytes |
コンパイル時間 | 242 ms |
コンパイル使用メモリ | 82,056 KB |
実行使用メモリ | 76,800 KB |
最終ジャッジ日時 | 2024-11-22 00:15:56 |
合計ジャッジ時間 | 9,704 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 |
ソースコード
T=int(input()) MOD=998244353 for i in range(T): N,M=map(int, input().split()) if N<=M: print((pow(10, N, MOD)-1)%MOD) continue N__M=N//M if N__M%2==0: print((pow(10, N%M, MOD)-1)%MOD) else: print(((-pow(10, N%M, MOD)-1)+(pow(10, M, MOD)+1))%MOD)