mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-10 06:18:48 +00:00
P7158 「dWoi R1」Password of Shady
R44423595
This commit is contained in:
parent
7e6f998ec6
commit
cda7fd96f7
23
problem/P7158/P7158.cpp
Normal file
23
problem/P7158/P7158.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
const int mod = 998244353;
|
||||
|
||||
int t, n, k;
|
||||
long long f[100005], g[100005];
|
||||
|
||||
int main() {
|
||||
scanf("%d", &t);
|
||||
f[1] = 8;
|
||||
g[1] = 1;
|
||||
for (int i = 2; i <= 100000; i++) {
|
||||
f[i] = (f[i - 1] * 9 + g[i - 1]) % mod;
|
||||
g[i] = (g[i - 1] * 9 + f[i - 1]) % mod;
|
||||
}
|
||||
while (t--) {
|
||||
scanf("%d%d", &n, &k);
|
||||
printf("%lld\n", n == 1 ? 9 : f[n]);
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user