結果
問題 |
No.2699 Simple Math (Returned)
|
ユーザー |
![]() |
提出日時 | 2024-03-30 00:36:03 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 426 ms / 2,000 ms |
コード長 | 613 bytes |
コンパイル時間 | 2,636 ms |
コンパイル使用メモリ | 245,960 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-09-30 17:18:16 |
合計ジャッジ時間 | 9,131 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 |
ソースコード
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; #include <atcoder/modint> using mint = atcoder::modint998244353; inline void solve() { int n, m; cin >> n >> m; n %= 2 * m; if (m < n) { cout << (mint(10).pow(m) - mint(10).pow(n - m)).val() << endl; } else { cout << (mint(10).pow(n) - 1).val() << endl; } } int main() { int t; cin >> t; while (t--) solve(); return 0; }