結果

問題 No.3304 INCREASE decrease
ユーザー hirayuu_yc
提出日時 2025-10-07 14:42:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 441 ms / 2,000 ms
コード長 183 bytes
コンパイル時間 463 ms
コンパイル使用メモリ 82,720 KB
実行使用メモリ 78,204 KB
最終ジャッジ日時 2025-10-07 14:43:11
合計ジャッジ時間 11,648 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

c=lambda s:(s*(s+1)//2-(s+1)//2)//2
for _ in range(int(input())):
 N,K=map(int,input().split());p=pow(10,K);t,b=divmod(N-1,p);print((c(t-1)*c(p-1)+(t//2*(c(p-1)-c(p-2-b))))%998244353)
0