結果
| 問題 |
No.2699 Simple Math (Returned)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-11 14:03:11 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 107 ms / 2,000 ms |
| コード長 | 405 bytes |
| コンパイル時間 | 2,643 ms |
| コンパイル使用メモリ | 245,920 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-09-28 17:30:10 |
| 合計ジャッジ時間 | 5,096 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 |
ソースコード
#include<bits/stdc++.h>
#include<atcoder/modint>
using namespace std;
using namespace atcoder;
using mint=modint998244353;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin>>T;
for(int i=0; i<T; i++){
int N,M;
cin>>N>>M;
N%=M*2;
if(N<=M){
cout<<(((mint)10).pow(N)-1).val()<<'\n';
}
else{
cout<<(((mint)10).pow(M)-((mint)10).pow(N%M)).val()<<'\n';
}
}
}