欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

雪莱方程武汉 2023 年(分析 + 快速功率)

最编程 2024-04-05 10:36:06
...
#define _CRT_SECURE_NO_WARNINGS 
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<math.h>
#include<unordered_map>
#include<map>
using namespace std;
#define LL  long long
const long long  mod =998244353;
const int N = 1e5 + 100;
LL n,k;
LL seek(LL x, LL y)
{
    LL e = 1;
    while (y)
    {
        if (y & 1)
            e = e * x % mod;
        x = x * x %mod;
        y = y >> 1;
    }
    return e;
}
int main()
{
    cin >> n >> k;
    LL ans = 1;
    ans = seek(1-k, n);
    cout << (ans % mod + mod) % mod << endl;
    return 0;
}