結果
| 問題 |
No.2699 Simple Math (Returned)
|
| コンテスト | |
| ユーザー |
Magentor
|
| 提出日時 | 2024-02-13 13:24:25 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 684 bytes |
| コンパイル時間 | 4,337 ms |
| コンパイル使用メモリ | 308,956 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-09-28 18:21:07 |
| 合計ジャッジ時間 | 10,051 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 WA * 6 |
ソースコード
#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();
}
}
Magentor