据说是个公式题.
牛客红包OI赛 C 小可爱表白

Code

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const long long mod = 998244353;

inline long long Pow(long long a, long long b) {
	long long res = 1, base = a;
	while (b) {
		if (b & 1) 
			res = res * base % mod;
		base = base * base % mod;
		b >>= 1;
	}
	return res;
}

long long n, m;
int main() {
	scanf("%lld", &n);
	printf("%lld", n * (n + 1) % mod * Pow(2, n - 2) % mod);
	return 0;
}    

相关文章:

  • 2021-12-10
  • 2021-04-01
  • 2022-01-01
  • 2021-11-03
  • 2021-05-28
  • 2021-09-13
猜你喜欢
  • 2021-09-18
  • 2022-02-04
  • 2021-10-22
  • 2022-01-04
  • 2022-12-23
  • 2021-12-23
  • 2021-03-30
相关资源
相似解决方案