結果
問題 | No.2699 Simple Math (Returned) |
ユーザー |
|
提出日時 | 2024-03-29 21:36:17 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 450 ms / 2,000 ms |
コード長 | 403 bytes |
コンパイル時間 | 3,289 ms |
コンパイル使用メモリ | 249,748 KB |
最終ジャッジ日時 | 2025-02-20 14:51:14 |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; #include <atcoder/all> using namespace atcoder; ll mod = 998244353; int main () { int T ; cin >> T; while (T--) { ll N, M; cin >> N >> M; ll a = N / M, b = N % M; ll ans = pow_mod(10, b, mod); if (a & 1) { ans = (pow_mod(10, M, mod) + 1 - ans + mod) % mod; } ans = (ans + mod - 1) % mod; cout << ans << endl; } }