結果
| 問題 |
No.2699 Simple Math (Returned)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-29 21:52:22 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 276 bytes |
| コンパイル時間 | 618 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 15,744 KB |
| 最終ジャッジ日時 | 2024-09-30 15:51:12 |
| 合計ジャッジ時間 | 9,724 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 TLE * 2 -- * 7 |
ソースコード
#N=qM+rとすると、10^N-1を10^M+1で割った余りは(-1)^q*10^r-1
MOD=998244353
T=int(input())
for i in range(T):
N,M=map(int,input().split())
q=N//M
r=N%M
a=[1,-1][q%2]*pow(10,r,MOD)-1
if q%2:
a=pow(10,M,MOD)-pow(10,r,MOD)
print(a % MOD)