結果
| 問題 |
No.2699 Simple Math (Returned)
|
| コンテスト | |
| ユーザー |
eve__fuyuki
|
| 提出日時 | 2024-03-30 01:14:11 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 624 bytes |
| コンパイル時間 | 1,943 ms |
| コンパイル使用メモリ | 195,788 KB |
| 最終ジャッジ日時 | 2025-02-20 15:46:46 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 WA * 9 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/modint>
using namespace std;
using mint = atcoder::modint998244353;
void fast_io() {
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
}
int main() {
fast_io();
int t;
cin >> t;
for (; t--;) {
int n, m;
cin >> n >> m;
if (n <= m) {
mint ans = mint(10).pow(n) - 1;
cout << ans.val() << "\n";
continue;
}
int p = n / m, r = n % m;
mint ans = mint(10).pow(r);
if (p % 2) {
ans *= -1;
}
ans--;
cout << ans.val() << "\n";
}
}
eve__fuyuki