雪莱方程武汉 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;
}
#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;
}
上一篇: 阿里系统的企业协同办公平台--"语雀
下一篇: [致青春] 致成长路上的琐事。