結果

問題 No.2699 Simple Math (Returned)
ユーザー achapi
提出日時 2024-11-09 15:25:10
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 519 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 4,202 ms
コンパイル使用メモリ 251,500 KB
最終ジャッジ日時 2025-02-25 03:19:03
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using mint = atcoder::modint998244353;
using namespace std;
int main(){
	int T;
	cin >> T;
	while (T--){
		int N, M;
		cin >> N >> M;
		if (N / M % 2 == 0){
			cout << (mint(10).pow(N % M) - 1).val() << endl;
		} else {
			cout << (mint(10).pow(M) - mint(10).pow(N % M)).val() << endl;
		}
	}
}
0