文章

74

粉丝

0

获赞

122

访问

9.8k

头像
求S(n) 题解:
P1500
发布于2026年1月31日 09:18
阅读数 128

#include<iostream>

using namespace std;

typedef long long LL;

int qmi(int a, int b, int p) {
	int res = 1 % p;
	while (b) {
		if (b & 1) res = (LL) res * a % p;
		a = (LL) a * a % p;
		b >>= 1;
	}
	return res;
}

int main() {
	
	int x;
	while (cin >> x) {
		cout << qmi(x,5,3) << endl;
	}

	return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发