結果

問題 No.2699 Simple Math (Returned)
ユーザー MagentorMagentor
提出日時 2024-02-13 13:24:25
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 684 bytes
コンパイル時間 5,810 ms
コンパイル使用メモリ 308,204 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-02-13 13:24:45
合計ジャッジ時間 11,757 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 296 ms
6,676 KB
testcase_02 AC 355 ms
6,676 KB
testcase_03 AC 295 ms
6,676 KB
testcase_04 WA -
testcase_05 AC 342 ms
6,676 KB
testcase_06 AC 329 ms
6,676 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
typedef long long ll;
using mint = modint998244353;
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

void solve(){
	std::cin.tie(0)->sync_with_stdio(0);
  ll n,m;cin>>n>>m;
  n %= 2*m;
  if(n<=m){mint ans = modpow(10ll,n,998244353LL);ans--;cout<<ans.val()<<endl;}
  //else{mint ans = modpow(10LL,m,998244353LL)-modpow(10LL,n-m,998244353LL);cout << ans.val()<<endl;}
}
int main() {
  int t;cin>>t;
  while(t--){
    solve();
  }
}
0